C# Class UnityEngine.Networking.NetworkTransport

Transport Layer API.

ファイルを表示 Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
AddHost ( HostTopology topology, [ port, [ ip ) : int

Creates a host based on Networking.HostTopology.

AddHostWithSimulator ( HostTopology topology, int minTimeout, int maxTimeout, [ port, [ ip ) : int

Create a host and configure them to simulate Internet latency (works on Editor and development build only).

AddWebsocketHost ( HostTopology topology, int port, [ ip ) : int

Created web socket host.

ConnectEndPoint ( int hostId, EndPoint endPoint, int exceptionConnectionId, byte &error ) : int
ConnectToNetworkPeer ( int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, byte &error ) : int
GetBroadcastConnectionInfo ( int hostId, string &address, int &port, byte &error ) : void
GetConnectionInfo ( int hostId, int connectionId, string &address, int &port, NetworkID &network, NodeID &dstNode, byte &error ) : void
Init ( ) : void

Initializes the NetworkTransport. Should be called before any other operations on the NetworkTransport are done.

Init ( GlobalConfig config ) : void
Send ( int hostId, int connectionId, int channelId, byte buffer, int size, byte &error ) : bool
StartBroadcastDiscovery ( int hostId, int broadcastPort, int key, int version, int subversion, byte buffer, int size, int timeout, byte &error ) : bool

Private Methods

Method Description
AddHost ( HostTopology topology ) : int
AddHost ( HostTopology topology, int port ) : int
AddHostWithSimulator ( HostTopology topology, int minTimeout, int maxTimeout ) : int
AddHostWithSimulator ( HostTopology topology, int minTimeout, int maxTimeout, int port ) : int
AddHostWrapper ( HostTopologyInternal topologyInt, string ip, int port, int minTimeout, int maxTimeout ) : int
AddHostWrapperWithoutIp ( HostTopologyInternal topologyInt, int port, int minTimeout, int maxTimeout ) : int
AddSceneId ( int id ) : void
AddWebsocketHost ( HostTopology topology, int port ) : int
AddWsHostWrapper ( HostTopologyInternal topologyInt, string ip, int port ) : int
AddWsHostWrapperWithoutIp ( HostTopologyInternal topologyInt, int port ) : int
CheckTopology ( HostTopology topology ) : void
Connect ( int hostId, string address, int port, int exeptionConnectionId, byte &error ) : int
ConnectAsNetworkHost ( int hostId, string address, int port, NetworkID network, SourceID source, NodeID node, byte &error ) : void
ConnectToNetworkPeer ( int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, int bytesPerSec, float bucketSizeFactor, byte &error ) : int
ConnectWithSimulator ( int hostId, string address, int port, int exeptionConnectionId, byte &error, ConnectionSimulatorConfig conf ) : int
Disconnect ( int hostId, int connectionId, byte &error ) : bool
DisconnectNetworkHost ( int hostId, byte &error ) : void
DoesEndPointUsePlatformProtocols ( EndPoint endPoint ) : bool
FinishSendMulticast ( int hostId, byte &error ) : bool
GetAssetId ( GameObject go ) : string
GetBroadcastConnectionInfo ( int hostId, int &port, byte &error ) : string
GetBroadcastConnectionMessage ( int hostId, byte buffer, int bufferSize, int &receivedSize, byte &error ) : void
GetConnectionInfo ( int hostId, int connectionId, int &port, ulong &network, ushort &dstNode, byte &error ) : string
GetCurrentIncomingMessageAmount ( ) : int
GetCurrentOutgoingMessageAmount ( ) : int
GetCurrentRtt ( int hostId, int connectionId, byte &error ) : int
GetMaxPacketSize ( ) : int
GetNetIOTimeuS ( ) : int
GetNetworkLostPacketNum ( int hostId, int connectionId, byte &error ) : int
GetNetworkTimestamp ( ) : int
GetNextSceneId ( ) : int
GetPacketReceivedRate ( int hostId, int connectionId, byte &error ) : int
GetPacketSentRate ( int hostId, int connectionId, byte &error ) : int
GetRemoteDelayTimeMS ( int hostId, int connectionId, int remoteTime, byte &error ) : int
GetRemotePacketReceivedRate ( int hostId, int connectionId, byte &error ) : int
InitWithNoParameters ( ) : void
InitWithParameters ( GlobalConfigInternal config ) : void
Internal_ConnectEndPoint ( int hostId, IntPtr sockAddrStorage, int sockAddrStorageLen, int exceptionConnectionId, byte &error ) : int
IsBroadcastDiscoveryRunning ( ) : bool
NetworkTransport ( ) : System
Receive ( int &hostId, int &connectionId, int &channelId, byte buffer, int bufferSize, int &receivedSize, byte &error ) : NetworkEventType
ReceiveFromHost ( int hostId, int &connectionId, int &channelId, byte buffer, int bufferSize, int &receivedSize, byte &error ) : NetworkEventType
ReceiveRelayEventFromHost ( int hostId, byte &error ) : NetworkEventType
RemoveHost ( int hostId ) : bool
SendMulticast ( int hostId, int connectionId, byte &error ) : bool
SendWrapper ( int hostId, int connectionId, int channelId, byte buffer, int size, byte &error ) : bool
SetBroadcastCredentials ( int hostId, int key, int version, int subversion, byte &error ) : void
SetPacketStat ( int direction, int packetStatId, int numMsgs, int numBytes ) : void
Shutdown ( ) : void
StartBroadcastDiscoveryWithData ( int hostId, int broadcastPort, int key, int version, int subversion, byte buffer, int size, int timeout, byte &error ) : bool
StartBroadcastDiscoveryWithoutData ( int hostId, int broadcastPort, int key, int version, int subversion, int timeout, byte &error ) : bool
StartSendMulticast ( int hostId, int channelId, byte buffer, int size, byte &error ) : bool
StopBroadcastDiscovery ( ) : void

Method Details

AddHost() public static method

Creates a host based on Networking.HostTopology.

public static AddHost ( HostTopology topology, [ port, [ ip ) : int
topology HostTopology The Networking.HostTopology associated with the host.
port [ Port to bind to (when 0 is selected, the OS will choose a port at random).
ip [ IP address to bind to.
return int

AddHostWithSimulator() public static method

Create a host and configure them to simulate Internet latency (works on Editor and development build only).

public static AddHostWithSimulator ( HostTopology topology, int minTimeout, int maxTimeout, [ port, [ ip ) : int
topology HostTopology The Networking.HostTopology associated with the host.
minTimeout int Minimum simulated delay in milliseconds.
maxTimeout int Maximum simulated delay in milliseconds.
port [ Port to bind to (when 0 is selected, the OS will choose a port at random).
ip [ IP address to bind to.
return int

AddWebsocketHost() public static method

Created web socket host.

public static AddWebsocketHost ( HostTopology topology, int port, [ ip ) : int
topology HostTopology The Networking.HostTopology associated with the host.
port int Port to bind to.
ip [ IP address to bind to.
return int

ConnectEndPoint() public static method

public static ConnectEndPoint ( int hostId, EndPoint endPoint, int exceptionConnectionId, byte &error ) : int
hostId int
endPoint System.Net.EndPoint
exceptionConnectionId int
error byte
return int

ConnectToNetworkPeer() public static method

public static ConnectToNetworkPeer ( int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, byte &error ) : int
hostId int
address string
port int
exceptionConnectionId int
relaySlotId int
network NetworkID
source SourceID
node NodeID
error byte
return int

GetBroadcastConnectionInfo() public static method

public static GetBroadcastConnectionInfo ( int hostId, string &address, int &port, byte &error ) : void
hostId int
address string
port int
error byte
return void

GetConnectionInfo() public static method

public static GetConnectionInfo ( int hostId, int connectionId, string &address, int &port, NetworkID &network, NodeID &dstNode, byte &error ) : void
hostId int
connectionId int
address string
port int
network NetworkID
dstNode NodeID
error byte
return void

Init() public static method

Initializes the NetworkTransport. Should be called before any other operations on the NetworkTransport are done.

public static Init ( ) : void
return void

Init() public static method

public static Init ( GlobalConfig config ) : void
config GlobalConfig
return void

Send() public static method

public static Send ( int hostId, int connectionId, int channelId, byte buffer, int size, byte &error ) : bool
hostId int
connectionId int
channelId int
buffer byte
size int
error byte
return bool

StartBroadcastDiscovery() public static method

public static StartBroadcastDiscovery ( int hostId, int broadcastPort, int key, int version, int subversion, byte buffer, int size, int timeout, byte &error ) : bool
hostId int
broadcastPort int
key int
version int
subversion int
buffer byte
size int
timeout int
error byte
return bool