Exemplo n.º 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));
        }
    }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public Client()
 {
     socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>();
     socket.Start(UdpEndPoint.Any);
     socket.Connect(new UdpEndPoint(UdpIPv4Address.Localhost, 14000));
 }
Exemplo n.º 4
0
 public Server()
 {
     socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>();
     socket.Start(new UdpEndPoint(UdpIPv4Address.Localhost, 14000));
     clients = new List<UdpConnection>();
 }
Exemplo n.º 5
0
 internal UdpStreamPool(UdpSocket s)
 {
     socket = s;
 }
Exemplo n.º 6
0
 internal UdpStreamPool(UdpSocket s)
 {
     socket = s;
 }