public static NetClientProvider CreateProvider( int bufferSizeByConnection = 4096, int maxConcurrentNumber = 8, NetProviderType netProviderType = NetProviderType.Tcp) { return(new NetClientProvider(bufferSizeByConnection, maxConcurrentNumber, netProviderType)); }
public static NetServerProvider CreateProvider( int bufferSizeByConnection = 4096, int maxNumberOfConnections = 64, NetProviderType netProviderType = NetProviderType.Tcp) { return(new NetServerProvider(bufferSizeByConnection, maxNumberOfConnections, netProviderType)); }
public NetClientProvider(NetProviderType netProviderType) { NetProviderType = netProviderType; this.bufferSizeByConnection = 4096; this.maxConcurrentNumber = 8; if (netProviderType == NetProviderType.Tcp) { tcpClientProvider = new TcpClientProvider(bufferSizeByConnection, maxConcurrentNumber); } else if (netProviderType == NetProviderType.Udp) { udpClientProvider = new UdpClientProvider(bufferSizeByConnection, maxConcurrentNumber); } }
public NetServerProvider(NetProviderType netProviderType) { this.NetProviderType = netProviderType; this.bufferSizeByConnection = 4096; this.maxNumberOfConnections = 64; if (netProviderType == NetProviderType.Tcp) { tcpServerProvider = new TcpServerProvider(maxNumberOfConnections, bufferSizeByConnection); } else if (netProviderType == NetProviderType.Udp) { udpServerProvider = new UdpServerProvider(); } }