public FastSocketConnection(Socket newConnectionSocket, int connectionID, FastSocket serverSocket) { this.ConnectionSocket = newConnectionSocket; this.ConnectionSocket.SendTimeout = serverSocket.MaxTimeOutMillisecond; this.ConnectionSocket.ReceiveTimeout = serverSocket.MaxTimeOutMillisecond; this.ConnectionID = connectionID; this.serverSocket = serverSocket; this.Encoding = serverSocket.Encoding; this.FastSocketService = serverSocket.FastSocketService; this.Enable = true; }
public FastSocket(FastSocketBuildOption option, IFastSocketService fastSocketService) { this.Ip = option.Ip; this.Port = option.Port; this.MaxConnections = option.MaxConnections; this.MaxTimeOutMillisecond = option.MaxTimeOutMillisecond; this.MaxTransPortBodyMB = option.MaxTransPortBodyMB; // this.Encoding = Encoding.UTF8; this.SocketProtocolType = EnumSocketProtocolType.tcp; this.FastSocketService = fastSocketService; Connections = new LinkedList <FastSocketConnection>(); }