public AsyncClientSocket(AsyncServerSocket server, Socket source) { this.Server = server; this.Source = source; source.LingerState = new LingerOption(true, 10); }
public bool StartListening(SocketConnectionAccepted callback) { if (_server == null) { _server = new AsyncServerSocket(callback); } return(_server.Listen()); }
/// <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); }