public Client() { state = ClientState.Disconnected; pendingDisconnectState = ClientState.Disconnected; replayProtection = new NetcodeReplayProtection(); replayProtection.Reset(); }
internal Client(Func <EndPoint, ISocketContext> socketFactory) { state = ClientState.Disconnected; pendingDisconnectState = ClientState.Disconnected; replayProtection = new NetcodeReplayProtection(); replayProtection.Reset(); this.socketFactory = socketFactory; }
public Client() { state = ClientState.Disconnected; pendingDisconnectState = ClientState.Disconnected; replayProtection = new NetcodeReplayProtection(); replayProtection.Reset(); socketFactory = (endpoint) => { var socket = new UDPSocketContext(endpoint.AddressFamily); var socketEndpoint = new IPEndPoint(endpoint.AddressFamily == AddressFamily.InterNetwork ? IPAddress.Any : IPAddress.IPv6Any, 0); socket.Bind(socketEndpoint); return(socket); }; }