protected Connection(IUdpSend channel, byte connectionId, ServiceTypes serviceType, ITrace trace) { Channel = channel; Trace = trace; _serviceType = serviceType; if (connectionId > 7) { throw new ArgumentOutOfRangeException(nameof(connectionId), "connectionId must be less than 8"); } ConnectionId = connectionId; }
public static Connection Create(ServiceTypes serviceType, int connectionId, IUdpSend udpSend, ITrace trace) { switch (serviceType) { case ServiceTypes.UnreliableUnordered: return(new UnreliableUnorderedConnection(udpSend, (byte)connectionId, new TracePrefixFacade(connectionId + " UU ", trace))); case ServiceTypes.UnreliableOrdered: return(new UnreliableOrderedConnection(udpSend, (byte)connectionId, new TracePrefixFacade(connectionId + " UO ", trace))); case ServiceTypes.ReliableOrdered: return(new ReliableOrderedConnection(udpSend, (byte)connectionId, new TracePrefixFacade(connectionId + " RO ", trace))); default: throw new ArgumentOutOfRangeException(); } }
internal ServerPeer(IpEndpoint ipEndpoint, IUdpSend udpSend, ITrace trace) { _ipEndpoint = ipEndpoint; _udpSend = udpSend; _trace = trace; }
public ReliableOrderedConnection(IUdpSend channel, byte connectionId, ITrace trace) : base(channel, connectionId, ServiceTypes.ReliableOrdered, trace) { _receivedOrderedAcknowledgePlayoutBuffers = new OrderedAcknowledgePlayoutBuffer <Paket>(PlayOut, trace); _acknowledgeSendBuffer = new AcknowledgeSendBuffer <Paket>(trace); }
public UnreliableUnorderedConnection(IUdpSend channel, byte connectionId, ITrace trace) : base(channel, connectionId, ServiceTypes.UnreliableUnordered, trace) { }