public virtual void Close() { lock (this) { Socket socket = this.socket; if (socket != null) { MalockInnetSocket.Close(socket); } this.socket = default(Socket); } }
private void ProcessAborted() { lock (this.syncobj) { Socket socket = this.socket; if (socket != null) { MalockInnetSocket.Close(socket); } this.connected = false; } this.OnAborted(EventArgs.Empty); }
public MalockStandbyClient(string identity, string address, int listenport) { this.socket = new MalockInnetSocket(identity, address, listenport, MalockMessage.LINK_MODE_SERVER); do { this.Identity = identity; this.Address = address; this.listenport = listenport; } while (false); this.socket.Received += this.OnReceived; this.socket.Connected += this.OnConnected; this.socket.Aborted += this.OnAborted; this.socket.Run(); }
public MalockStandbyClient(MalockEngine engine, string identity, string address, int listenport) { if (engine == null) { throw new ArgumentNullException("engine"); } this.engine = engine; do { this.Identity = identity; this.Address = address; this.listenport = listenport; } while (false); this.socket = new MalockInnetSocket(identity, address, listenport, MalockMessage.LINK_MODE_SERVER); this.socket.Received += this.OnReceived; this.socket.Run(); }
public MalockStandbyClient(MalockEngine engine, MalockConfiguration configuration) { if (configuration == null) { throw new ArgumentNullException("configuration"); } if (engine == null) { throw new ArgumentNullException("engine"); } this.configuration = configuration; this.engine = engine; do { this.Identity = configuration.Identity; this.Address = this.GetAddress(configuration); this.listenport = configuration.Port; } while (false); this.socket = new MalockInnetSocket(this.Identity, this.Address, this.GetListenPort(), MalockMessage.LINK_MODE_SERVER); this.socket.Received += this.OnReceived; this.socket.Connected += this.OnConnected; this.socket.Aborted += this.OnAborted; this.socket.Run(); }