Exemplo n.º 1
0
        public AsyncClientSocket(AsyncServerSocket server, Socket source)
        {
            this.Server = server;
            this.Source = source;

            source.LingerState = new LingerOption(true, 10);
        }
Exemplo n.º 2
0
 public bool StartListening(SocketConnectionAccepted callback)
 {
     if (_server == null)
     {
         _server = new AsyncServerSocket(callback);
     }
     return(_server.Listen());
 }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a new client socket
        /// </summary>
        /// <param name="server">The server which is creating the socket</param>
        /// <param name="socket"></param>
        public AsyncSocket(AsyncServerSocket server, Socket socket)
        {
            //client
            _client = new AsyncClientSocket(server, socket);

            var endpoint = (IPEndPoint)socket.RemoteEndPoint;

            this._remoteAddress = new TcpAddress(endpoint.Address, endpoint.Port);
        }