• Api Documentation
  • Manual
Show / Hide Table of Contents
  • FishNet
    • InstanceFinder
  • FishNet.Authenticating
    • Authenticator
  • FishNet.Broadcast
    • IBroadcast
  • FishNet.Broadcast.Helping
    • BroadcastHandlerBase
  • FishNet.CodeGenerating
    • AllowMutableSyncTypeAttribute
    • CustomComparerAttribute
    • DefaultDeltaReaderAttribute
    • DefaultDeltaWriterAttribute
    • DefaultReaderAttribute
    • DefaultWriterAttribute
    • ExcludeSerializationAttribute
    • IncludeSerializationAttribute
    • NotSerializerAttribute
    • ReadUnallocatedAttribute
    • UseGlobalCustomSerializerAttribute
  • FishNet.Component.Animating
    • NetworkAnimator
  • FishNet.Component.ColliderRollback
    • ColliderRollback
    • RollbackManager
    • RollbackPhysicsType
  • FishNet.Component.Observing
    • DistanceCondition
    • GridCondition
    • GridEntry
    • HashGrid
    • HashGrid.GridAxes
    • HostOnlyCondition
    • MatchCondition
    • MatchCondition.ConditionCollections
    • OwnerOnlyCondition
    • SceneCondition
  • FishNet.Component.Ownership
    • PredictedOwner
    • PredictedSpawn
  • FishNet.Component.Prediction
    • NetworkCollider
    • NetworkCollider2D
    • NetworkCollision
    • NetworkCollision2D
    • NetworkTrigger
    • NetworkTrigger2D
    • OfflineRigidbody
    • Rigidbody2DState
    • RigidbodyPauser
    • RigidbodyState
    • RigidbodyStateExtensions
    • RigidbodyStateSerializers
    • RigidbodyType
  • FishNet.Component.Scenes
    • DefaultScene
  • FishNet.Component.Spawning
    • PlayerSpawner
  • FishNet.Component.Transforming
    • DetachableNetworkTickSmoother
    • MonoTickSmoother
    • NetworkTickSmoother
    • NetworkTransform
    • NetworkTransform.ComponentConfigurationType
    • NetworkTransform.GoalData
    • NetworkTransform.RateData
    • NetworkTransform.SnappedAxes
    • NetworkTransform.TransformData
    • NetworkTransform.TransformData.ExtrapolateState
    • SynchronizedProperty
  • FishNet.Component.Utility
    • BandwidthDisplay
    • PingDisplay
  • FishNet.Connection
    • NetworkConnection
    • NetworkConnectionExtensions
  • FishNet.Managing
    • NetworkManager
    • NetworkManager.HostIterationOrder
    • NetworkManager.PersistenceType
    • NetworkManagerExtensions
    • RemoteTimeoutType
  • FishNet.Managing.Client
    • ClientManager
    • ClientObjects
  • FishNet.Managing.Debugging
    • DebugManager
  • FishNet.Managing.Logging
    • LevelLoggingConfiguration
    • LoggingConfiguration
    • LoggingType
  • FishNet.Managing.Object
    • DualPrefab
    • ManagedObjects
  • FishNet.Managing.Observing
    • ObserverManager
  • FishNet.Managing.Predicting
    • PredictionManager
    • PredictionManager.PostPhysicsSyncTransformDel
    • PredictionManager.PostReconcileDel
    • PredictionManager.PostReplicateReplayDel
    • PredictionManager.PrePhysicsSyncTransformDel
    • PredictionManager.PreReconcileDel
    • PredictionManager.PreReplicateReplayDel
    • PredictionManager.ReconcileDel
    • PredictionManager.ReplicateReplayDel
    • ReplicateStateOrder
  • FishNet.Managing.Scened
    • ClientPresenceChangeEventArgs
    • DefaultSceneProcessor
    • EmptyStartScenesBroadcast
    • LoadOptions
    • LoadParams
    • LoadQueueData
    • PreferredScene
    • ReplaceOption
    • SceneLoadData
    • SceneLoadEndEventArgs
    • SceneLoadPercentEventArgs
    • SceneLoadStartEventArgs
    • SceneLookupData
    • SceneManager
    • SceneProcessorBase
    • SceneScopeType
    • SceneUnloadData
    • SceneUnloadEndEventArgs
    • SceneUnloadStartEventArgs
    • UnloadedScene
    • UnloadOptions
    • UnloadOptions.ServerUnloadMode
    • UnloadParams
    • UnloadQueueData
  • FishNet.Managing.Server
    • ClientConnectionChangeBroadcast
    • ConnectedClientsBroadcast
    • KickReason
    • ServerManager
    • ServerObjects
  • FishNet.Managing.Statistic
    • NetworkTrafficArgs
    • NetworkTraficStatistics
    • StatisticsManager
  • FishNet.Managing.Timing
    • EstimatedTick
    • EstimatedTick.OldTickOption
    • PhysicsMode
    • PreciseTick
    • PreciseTickExtensions
    • PreciseTickSerializer
    • TickRounding
    • TickType
    • TimeManager
  • FishNet.Managing.Transporting
    • IntermediateLayer
    • LatencySimulator
    • TransportManager
  • FishNet.Managing.Utility
    • Packets
  • FishNet.Object
    • ClientAttribute
    • DataOrderType
    • DespawnType
    • EmptyNetworkBehaviour
    • GlobalPreserveOwnedObjects
    • NetworkBehaviour
    • NetworkObject
    • NetworkObject.HostVisibilityUpdatedDelegate
    • NetworkObjectIdComparer
    • NetworkPreserveOwnedObjects
    • ObserversRpcAttribute
    • ReplicateState
    • ReplicateStateExtensions
    • RpcAttribute
    • ServerAttribute
    • ServerRpcAttribute
    • TargetRpcAttribute
    • TransformProperties
    • TransformPropertiesCls
    • TransformPropertiesFlag
    • TransformPropertiesOptionExtensions
  • FishNet.Object.Prediction
    • AdaptiveInterpolationType
    • ChildTransformTickSmoother
    • IReconcileData
    • IReplicateData
    • PredictionigidbodySerializers
    • PredictionRigidbody
    • PredictionRigidbody.AllForceData
    • PredictionRigidbody.EntryData
    • PredictionRigidbody.ForceApplicationType
    • PredictionRigidbody.IForceData
    • PredictionRigidbody2D
    • PredictionRigidbody2D.AllForceData
    • PredictionRigidbody2D.EntryData
    • PredictionRigidbody2D.ForceApplicationType
    • PredictionRigidbody2D2DSerializers
    • ReconcileAttribute
    • ReplicateAttribute
  • FishNet.Object.Synchronizing
    • ByteSyncVar
    • DoubleSyncVar
    • FloatSyncVar
    • ICustomSync
    • IntSyncVar
    • LongSyncVar
    • ReadPermission
    • SbyteSyncVar
    • ShortSyncVar
    • SyncDictionary<TKey, TValue>
    • SyncHashSet<T>
    • SyncList<T>
    • SyncObjectAttribute
    • SyncStopwatch
    • SyncStopwatch.SyncTypeChanged
    • SyncStopwatchOperation
    • SyncTimer
    • SyncTimer.SyncTypeChanged
    • SyncTimerOperation
    • SyncTypeSettings
    • SyncVarAttribute
    • UIntSyncVar
    • ULongSyncVar
    • UShortSyncVar
    • Vector2IntSyncVar
    • Vector2SyncVar
    • Vector3IntSyncVar
    • Vector3SyncVar
    • Vector4SyncVar
    • WritePermission
  • FishNet.Observing
    • HostVisibilityUpdateTypes
    • NetworkObserver
    • NetworkObserver.ConditionOverrideType
    • ObserverCondition
    • ObserverConditionType
  • FishNet.Serializing
    • AutoPackType
    • DeltaSerializerOption
    • DeltaSerializerOptionExtensions
    • PooledReader
    • PooledWriter
    • Reader
    • Reader.DataSource
    • ReaderPool
    • SubStream
    • Writer
    • WriterPool
  • FishNet.Transporting
    • Channel
    • ClientConnectionStateArgs
    • ClientReceivedDataArgs
    • ConnectedClientsArgs
    • IPAddressType
    • LocalConnectionState
    • RemoteConnectionState
    • RemoteConnectionStateArgs
    • ServerConnectionStateArgs
    • ServerReceivedDataArgs
    • Transport
    • TransportConsts
  • GameKit.Dependencies.Utilities
    • ApplicationState
    • Arrays
    • BasicQueue<T>
    • Booleans
    • Bytes
    • CanvaseGroups
    • CanvasGroupBlockingType
    • CollectionCaches<T>
    • CollectionCaches<T1, T2>
    • Collider2DExtensions
    • ColliderExtensions
    • DictionaryFN
    • Disks
    • Enums
    • Floats
    • Hashing
    • Ints
    • IOs
    • IResettable
    • IWeighted
    • Layers
    • LayoutGroups
    • Materials
    • Maths
    • ObjectCaches<T>
    • Objects
    • Particles
    • PointerMonoBehaviour
    • Quaternions
    • ResettableCollectionCaches<T>
    • ResettableCollectionCaches<T1, T2>
    • ResettableObjectCaches<T>
    • ResettableT1CollectionCaches<T1, T2>
    • ResettableT2CollectionCaches<T1, T2>
    • Strings
    • Transforms
    • UInts
    • Vectors
    • WeightedRandom
  • GameKit.Dependencies.Utilities.ObjectPooling
    • ListStack<GameObject>
    • ObjectPool
    • PoolData
  • GameKit.Dependencies.Utilities.ObjectPooling.Examples
    • Projectile
    • ProjectileSpawner
  • GameKit.Dependencies.Utilities.Types
    • ByteRange
    • CanvasGroupFader
    • CanvasGroupFader.FadeGoalType
    • CanvasTracker
    • DDOL
    • FloatRange
    • FloatRange2D
    • IntRange
    • IOrderable
    • RectTransformResizer
    • RectTransformResizer.ResizeData
    • RectTransformResizer.ResizeDelegate
    • ResettableRingBuffer<T>
    • ResettableRingBuffer<T>.Enumerator
    • RingBuffer<T>
    • RingBuffer<T>.Enumerator
    • SceneAttribute
    • ScrollbarValueSetter
    • SingletonScriptableObject<T>
    • SmoothCameraTarget
    • TimedOperation
    • UIntRange
    • Vector2Range
  • GameKit.Dependencies.Utilities.Types.CanvasContainers
    • ButtonData
    • ButtonData.PressedDelegate
    • FloatingContainer
    • FloatingImage
    • ImageButtonData
    • ResizableContainer
  • GameKit.Dependencies.Utilities.Types.OptionMenuButtons
    • FloatingOptions

Class Transport

Processes connection states, and data sent to and from a socket.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
Transport
Inherited Members
UnityEngine.MonoBehaviour.IsInvoking()
UnityEngine.MonoBehaviour.CancelInvoke()
UnityEngine.MonoBehaviour.Invoke(System.String, System.Single)
UnityEngine.MonoBehaviour.InvokeRepeating(System.String, System.Single, System.Single)
UnityEngine.MonoBehaviour.CancelInvoke(System.String)
UnityEngine.MonoBehaviour.IsInvoking(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String)
UnityEngine.MonoBehaviour.StartCoroutine(System.String, System.Object)
UnityEngine.MonoBehaviour.StartCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StartCoroutine_Auto(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(System.Collections.IEnumerator)
UnityEngine.MonoBehaviour.StopCoroutine(UnityEngine.Coroutine)
UnityEngine.MonoBehaviour.StopCoroutine(System.String)
UnityEngine.MonoBehaviour.StopAllCoroutines()
UnityEngine.MonoBehaviour.print(System.Object)
UnityEngine.MonoBehaviour.useGUILayout
UnityEngine.MonoBehaviour.runInEditMode
UnityEngine.Behaviour.enabled
UnityEngine.Behaviour.isActiveAndEnabled
UnityEngine.Component.GetComponent(System.Type)
UnityEngine.Component.GetComponent<T>()
UnityEngine.Component.TryGetComponent(System.Type, UnityEngine.Component)
UnityEngine.Component.TryGetComponent<T>(T)
UnityEngine.Component.GetComponent(System.String)
UnityEngine.Component.GetComponentInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInChildren(System.Type)
UnityEngine.Component.GetComponentInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentInChildren<T>()
UnityEngine.Component.GetComponentsInChildren(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInChildren(System.Type)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean)
UnityEngine.Component.GetComponentsInChildren<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInChildren<T>()
UnityEngine.Component.GetComponentsInChildren<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentInParent(System.Type)
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentInParent<T>()
UnityEngine.Component.GetComponentsInParent(System.Type, System.Boolean)
UnityEngine.Component.GetComponentsInParent(System.Type)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean)
UnityEngine.Component.GetComponentsInParent<T>(System.Boolean, System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponentsInParent<T>()
UnityEngine.Component.GetComponents(System.Type)
UnityEngine.Component.GetComponents(System.Type, System.Collections.Generic.List<UnityEngine.Component>)
UnityEngine.Component.GetComponents<T>(System.Collections.Generic.List<T>)
UnityEngine.Component.GetComponents<T>()
UnityEngine.Component.CompareTag(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessageUpwards(System.String, System.Object)
UnityEngine.Component.SendMessageUpwards(System.String)
UnityEngine.Component.SendMessageUpwards(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, System.Object)
UnityEngine.Component.SendMessage(System.String)
UnityEngine.Component.SendMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.SendMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object, UnityEngine.SendMessageOptions)
UnityEngine.Component.BroadcastMessage(System.String, System.Object)
UnityEngine.Component.BroadcastMessage(System.String)
UnityEngine.Component.BroadcastMessage(System.String, UnityEngine.SendMessageOptions)
UnityEngine.Component.transform
UnityEngine.Component.gameObject
UnityEngine.Component.tag
UnityEngine.Object.GetInstanceID()
UnityEngine.Object.GetHashCode()
UnityEngine.Object.Equals(System.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform)
UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Instantiate<T>(T)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Vector3, UnityEngine.Quaternion, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform)
UnityEngine.Object.Instantiate<T>(T, UnityEngine.Transform, System.Boolean)
UnityEngine.Object.Destroy(UnityEngine.Object, System.Single)
UnityEngine.Object.Destroy(UnityEngine.Object)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object, System.Boolean)
UnityEngine.Object.DestroyImmediate(UnityEngine.Object)
UnityEngine.Object.FindObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfType(System.Type, System.Boolean)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsByType(System.Type, UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.DontDestroyOnLoad(UnityEngine.Object)
UnityEngine.Object.DestroyObject(UnityEngine.Object, System.Single)
UnityEngine.Object.DestroyObject(UnityEngine.Object)
UnityEngine.Object.FindSceneObjectsOfType(System.Type)
UnityEngine.Object.FindObjectsOfTypeIncludingAssets(System.Type)
UnityEngine.Object.FindObjectsOfType<T>()
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>()
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindObjectsOfTypeAll(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type)
UnityEngine.Object.FindFirstObjectByType(System.Type)
UnityEngine.Object.FindAnyObjectByType(System.Type)
UnityEngine.Object.FindObjectOfType(System.Type, System.Boolean)
UnityEngine.Object.FindFirstObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType(System.Type, UnityEngine.FindObjectsInactive)
UnityEngine.Object.ToString()
UnityEngine.Object.name
UnityEngine.Object.hideFlags
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FishNet.Transporting
Assembly: FishNet.Runtime.dll
Syntax
public abstract class Transport : MonoBehaviour

Properties

Index

Index this transport belongs to when using multiple transports at once.

Declaration
public int Index { get; }
Property Value
Type Description
System.Int32

NetworkManager

NetworkManager for this transport.

Declaration
public NetworkManager NetworkManager { get; }
Property Value
Type Description
NetworkManager

Methods

GetClientAddress()

Returns which address the client will connect to.

Declaration
public virtual string GetClientAddress()
Returns
Type Description
System.String

GetConnectionAddress(Int32)

Gets the address of a remote connection Id.

Declaration
public abstract string GetConnectionAddress(int connectionId)
Parameters
Type Name Description
System.Int32 connectionId

Connectionid to get the address for.

Returns
Type Description
System.String

GetConnectionState(Boolean)

Gets the current local ConnectionState.

Declaration
public abstract LocalConnectionState GetConnectionState(bool server)
Parameters
Type Name Description
System.Boolean server

True if getting ConnectionState for the server.

Returns
Type Description
LocalConnectionState

GetConnectionState(Int32)

Gets the current ConnectionState of a client connected to the server. Can only be called on the server.

Declaration
public abstract RemoteConnectionState GetConnectionState(int connectionId)
Parameters
Type Name Description
System.Int32 connectionId

ConnectionId to get ConnectionState for.

Returns
Type Description
RemoteConnectionState

GetMaximumClients()

Returns the maximum number of clients allowed to connect to the server. If the transport does not support this method the value -1 is returned.

Declaration
public virtual int GetMaximumClients()
Returns
Type Description
System.Int32

Maximum clients transport allows.

GetMTU(Byte)

Gets the MTU for a channel.

Declaration
public abstract int GetMTU(byte channel)
Parameters
Type Name Description
System.Byte channel

Channel to get MTU for.

Returns
Type Description
System.Int32

MTU of channel.

GetPort()

Gets which port to use.

Declaration
public virtual ushort GetPort()
Returns
Type Description
System.UInt16

GetServerBindAddress(IPAddressType)

Gets which address the server will bind to.

Declaration
public virtual string GetServerBindAddress(IPAddressType addressType)
Parameters
Type Name Description
IPAddressType addressType

Address type to return.

Returns
Type Description
System.String

GetTimeout(Boolean)

Gets how long in seconds until either the server or client socket must go without data before being timed out.

Declaration
public virtual float GetTimeout(bool asServer)
Parameters
Type Name Description
System.Boolean asServer

True to get the timeout for the server socket, false for the client socket.

Returns
Type Description
System.Single

HandleClientConnectionState(ClientConnectionStateArgs)

Handles a ConnectionStateArgs for the local client.

Declaration
public abstract void HandleClientConnectionState(ClientConnectionStateArgs connectionStateArgs)
Parameters
Type Name Description
ClientConnectionStateArgs connectionStateArgs

Data being handled.

HandleClientReceivedDataArgs(ClientReceivedDataArgs)

Handles a ClientReceivedDataArgs.

Declaration
public abstract void HandleClientReceivedDataArgs(ClientReceivedDataArgs receivedDataArgs)
Parameters
Type Name Description
ClientReceivedDataArgs receivedDataArgs

Data being handled.

HandleRemoteConnectionState(RemoteConnectionStateArgs)

Handles a ConnectionStateArgs for a remote client.

Declaration
public abstract void HandleRemoteConnectionState(RemoteConnectionStateArgs connectionStateArgs)
Parameters
Type Name Description
RemoteConnectionStateArgs connectionStateArgs

Data being handled.

HandleServerConnectionState(ServerConnectionStateArgs)

Handles a ConnectionStateArgs for the local server.

Declaration
public abstract void HandleServerConnectionState(ServerConnectionStateArgs connectionStateArgs)
Parameters
Type Name Description
ServerConnectionStateArgs connectionStateArgs

Data being handled.

HandleServerReceivedDataArgs(ServerReceivedDataArgs)

Handles a ServerReceivedDataArgs.

Declaration
public abstract void HandleServerReceivedDataArgs(ServerReceivedDataArgs receivedDataArgs)
Parameters
Type Name Description
ServerReceivedDataArgs receivedDataArgs

Data being handled.

Initialize(NetworkManager, Int32)

Initializes the transport. Use this instead of Awake.

Index this transport belongs to when using multiple transports at once.
Declaration
public virtual void Initialize(NetworkManager networkManager, int transportIndex)
Parameters
Type Name Description
NetworkManager networkManager
System.Int32 transportIndex

IsLocalTransport(Int32)

Returns if the transport is only run locally, offline. While true several security checks are disabled.

Declaration
public virtual bool IsLocalTransport(int connectionid)
Parameters
Type Name Description
System.Int32 connectionid

Optional connectionId to check against.

Returns
Type Description
System.Boolean

IterateIncoming(Boolean)

Processes data received by the socket.

Declaration
public abstract void IterateIncoming(bool server)
Parameters
Type Name Description
System.Boolean server

True to process data received on the server.

IterateOutgoing(Boolean)

Processes data to be sent by the socket.

Declaration
public abstract void IterateOutgoing(bool server)
Parameters
Type Name Description
System.Boolean server

True to process data received on the server.

SendToClient(Byte, ArraySegment<Byte>, Int32)

Sends to a client.

Declaration
public abstract void SendToClient(byte channelId, ArraySegment<byte> segment, int connectionId)
Parameters
Type Name Description
System.Byte channelId

Channel to use.

System.ArraySegment<System.Byte> segment

Data to send.

System.Int32 connectionId

ConnectionId to send to. When sending to clients can be used to specify which connection to send to.

SendToServer(Byte, ArraySegment<Byte>)

Sends to the server.

Declaration
public abstract void SendToServer(byte channelId, ArraySegment<byte> segment)
Parameters
Type Name Description
System.Byte channelId

Channel to use.

System.ArraySegment<System.Byte> segment

Data to send.

SetClientAddress(String)

Sets which address the client will connect to.

Declaration
public virtual void SetClientAddress(string address)
Parameters
Type Name Description
System.String address

Address client will connect to.

SetMaximumClients(Int32)

Sets the maximum number of clients allowed to connect to the server. If applied at runtime and clients exceed this value existing clients will stay connected but new clients may not connect.

Declaration
public virtual void SetMaximumClients(int value)
Parameters
Type Name Description
System.Int32 value

Maximum clients to allow.

SetPort(UInt16)

Sets which port to use.

Declaration
public virtual void SetPort(ushort port)
Parameters
Type Name Description
System.UInt16 port

Port to use.

SetServerBindAddress(String, IPAddressType)

Sets which address the server will bind to.

Declaration
public virtual void SetServerBindAddress(string address, IPAddressType addressType)
Parameters
Type Name Description
System.String address

Address server will bind to.

IPAddressType addressType

Address type to set.

SetTimeout(Single, Boolean)

Sets how long in seconds until either the server or client socket must go without data before being timed out.

Declaration
public virtual void SetTimeout(float value, bool asServer)
Parameters
Type Name Description
System.Single value
System.Boolean asServer

True to set the timeout for the server socket, false for the client socket.

Shutdown()

Stops both client and server.

Declaration
public abstract void Shutdown()

StartConnection(Boolean)

Starts the local server or client using configured settings.

Declaration
public abstract bool StartConnection(bool server)
Parameters
Type Name Description
System.Boolean server

True to start server.

Returns
Type Description
System.Boolean

StopConnection(Boolean)

Stops the local server or client.

Declaration
public abstract bool StopConnection(bool server)
Parameters
Type Name Description
System.Boolean server

True to stop server.

Returns
Type Description
System.Boolean

StopConnection(Int32, Boolean)

Stops a remote client from the server, disconnecting the client.

Declaration
public abstract bool StopConnection(int connectionId, bool immediately)
Parameters
Type Name Description
System.Int32 connectionId

ConnectionId of the client to disconnect.

System.Boolean immediately

True to abrutly stop the client socket. The technique used to accomplish immediate disconnects may vary depending on the transport. When not using immediate disconnects it's recommended to perform disconnects using the ServerManager rather than accessing the transport directly.

Returns
Type Description
System.Boolean

Events

OnClientConnectionState

Called when a connection state changes for the local client.

Declaration
public abstract event Action<ClientConnectionStateArgs> OnClientConnectionState
Event Type
Type Description
System.Action<ClientConnectionStateArgs>

OnClientReceivedData

Called when the client receives data.

Declaration
public abstract event Action<ClientReceivedDataArgs> OnClientReceivedData
Event Type
Type Description
System.Action<ClientReceivedDataArgs>

OnRemoteConnectionState

Called when a connection state changes for a remote client.

Declaration
public abstract event Action<RemoteConnectionStateArgs> OnRemoteConnectionState
Event Type
Type Description
System.Action<RemoteConnectionStateArgs>

OnServerConnectionState

Called when a connection state changes for the local server.

Declaration
public abstract event Action<ServerConnectionStateArgs> OnServerConnectionState
Event Type
Type Description
System.Action<ServerConnectionStateArgs>

OnServerReceivedData

Called when the server receives data.

Declaration
public abstract event Action<ServerReceivedDataArgs> OnServerReceivedData
Event Type
Type Description
System.Action<ServerReceivedDataArgs>
In This Article
Back to top Generated by DocFX