Пример #1
0
    void Start()
    {
        socket = UdpKitUnityUtils.CreatePlatformSpecificSocket<demoSerializer>();

        if (isServer) {
            socket.Start(new UdpEndPoint(serverAddress));
        } else {
            socket.Start(UdpEndPoint.Any);
            socket.Connect(new UdpEndPoint(serverAddress));
        }
    }
Пример #2
0
 internal UdpConnection(UdpSocket sock, UdpConnectionMode m, UdpEndPoint ep)
 {
     socket = sock;
     mode = m;
     endpoint = ep;
     networkRtt = socket.Config.DefaultNetworkPing;
     aliasedRtt = socket.Config.DefaultAliasedPing;
     mtu = sock.Config.DefaultMtu;
     alwaysSendMtu = sock.Config.DefaultAlwaysSendMtu;
     serializer = sock.CreateSerializer();
     state = UdpConnectionState.Connecting;
     recvTime = socket.GetCurrentTime();
     sendTime = recvTime;
     stats = new UdpConnectionStats();
     sendWindow = new UdpRingBuffer<UdpHandle>(sock.Config.PacketWindow);
 }
Пример #3
0
 public Client()
 {
     socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>();
     socket.Start(UdpEndPoint.Any);
     socket.Connect(new UdpEndPoint(UdpIPv4Address.Localhost, 14000));
 }
Пример #4
0
 public Server()
 {
     socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>();
     socket.Start(new UdpEndPoint(UdpIPv4Address.Localhost, 14000));
     clients = new List<UdpConnection>();
 }
Пример #5
0
 internal UdpStreamPool(UdpSocket s)
 {
     socket = s;
 }
Пример #6
0
 internal UdpStreamPool(UdpSocket s)
 {
     socket = s;
 }