void Start() { socket = UdpKitUnityUtils.CreatePlatformSpecificSocket<demoSerializer>(); if (isServer) { socket.Start(new UdpEndPoint(serverAddress)); } else { socket.Start(UdpEndPoint.Any); socket.Connect(new UdpEndPoint(serverAddress)); } }
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); }
public Client() { socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>(); socket.Start(UdpEndPoint.Any); socket.Connect(new UdpEndPoint(UdpIPv4Address.Localhost, 14000)); }
public Server() { socket = UdpSocket.Create<UdpPlatformManaged, ChatSerializer>(); socket.Start(new UdpEndPoint(UdpIPv4Address.Localhost, 14000)); clients = new List<UdpConnection>(); }
internal UdpStreamPool(UdpSocket s) { socket = s; }