INetworkTransport.cs
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Net;
using UnityEngine.Networking.Types;
namespace UnityEngine.Networking
{
[Obsolete("The high level API classes are deprecated and will be removed in the future.")]
public interface INetworkTransport
{
void Init();
void Init(GlobalConfig config);
bool IsStarted { get; }
void Shutdown();
int AddHost(HostTopology topology, int port, string ip);
int AddWebsocketHost(HostTopology topology, int port, string ip);
int ConnectWithSimulator(int hostId, string address, int port, int specialConnectionId, out byte error, ConnectionSimulatorConfig conf);
int Connect(int hostId, string address, int port, int specialConnectionId, out byte error);
void ConnectAsNetworkHost(int hostId, string address, int port, NetworkID network, SourceID source, NodeID node, out byte error);
int ConnectToNetworkPeer(int hostId, string address, int port, int specialConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, out byte error);
int ConnectEndPoint(int hostId, EndPoint endPoint, int specialConnectionId, out byte error);
bool DoesEndPointUsePlatformProtocols(EndPoint endPoint);
int AddHostWithSimulator(HostTopology topology, int minTimeout, int maxTimeout, int port);
bool RemoveHost(int hostId);
bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error);
NetworkEventType Receive(out int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error);
NetworkEventType ReceiveFromHost(int hostId, out int connectionId, out int channelId, byte[] buffer, int bufferSize, out int receivedSize, out byte error);
NetworkEventType ReceiveRelayEventFromHost(int hostId, out byte error);
int GetCurrentRTT(int hostId, int connectionId, out byte error);
void GetConnectionInfo(int hostId, int connectionId, out string address, out int port, out NetworkID network, out NodeID dstNode, out byte error);
bool Disconnect(int hostId, int connectionId, out byte error);
void SetBroadcastCredentials(int hostId, int key, int version, int subversion, out byte error);
bool StartBroadcastDiscovery(int hostId, int broadcastPort, int key, int version, int subversion, byte[] buffer, int size, int timeout, out byte error);
void GetBroadcastConnectionInfo(int hostId, out string address, out int port, out byte error);
void GetBroadcastConnectionMessage(int hostId, byte[] buffer, int bufferSize, out int receivedSize, out byte error);
void StopBroadcastDiscovery();
void SetPacketStat(int direction, int packetStatId, int numMsgs, int numBytes);
}
}