コード例 #1
0
        /// <summary>
        /// Creates a new TcpCommunicationChannel object.
        /// </summary>
        /// <param name="clientSocket">A connected Socket object that is
        /// used to communicate over network</param>
        public TcpCommunicationChannel(Socket clientSocket)
        {
            _clientSocket = clientSocket;
            _clientSocket.NoDelay = true;

            var ipEndPoint = (IPEndPoint)_clientSocket.RemoteEndPoint;
            _remoteEndPoint = new ScsTcpEndPoint(ipEndPoint.Address.ToString(), ipEndPoint.Port);

            _buffer = new byte[ReceiveBufferSize];
            _syncLock = new object();
        }
コード例 #2
0
ファイル: ScsTcpClient.cs プロジェクト: aerzy/OpenNos
 /// <summary>
 /// Creates a new ScsTcpClient object.
 /// </summary>
 /// <param name="serverEndPoint">The endpoint address to connect to the server</param>
 public ScsTcpClient(ScsTcpEndPoint serverEndPoint)
 {
     _serverEndPoint = serverEndPoint;
 }
コード例 #3
0
ファイル: ScsTcpServer.cs プロジェクト: aerzy/OpenNos
 /// <summary>
 /// Creates a new ScsTcpServer object.
 /// </summary>
 /// <param name="endPoint">The endpoint address of the server to listen incoming connections</param>
 public ScsTcpServer(ScsTcpEndPoint endPoint)
 {
     _endPoint = endPoint;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new TcpConnectionListener for given endpoint.
 /// </summary>
 /// <param name="endPoint">The endpoint address of the server to listen incoming connections</param>
 public TcpConnectionListener(ScsTcpEndPoint endPoint)
 {
     _endPoint = endPoint;
 }