public CDIncommingConnection(Socket socket, byte[] keyWordIn = null, CDProtocol cdp = null) { this.keyWordIn = Hash(keyWordIn ?? new byte[0]); this.protocol = cdp; this.stream = new NetworkStream(socket); this.socket = socket; this.address = this.socket.RemoteEndPoint as IPEndPoint; }
public CDOutgoingConnection(string ip, int port, byte[] keyWordOut = null, CDProtocol cdp = null, Action<CDOutgoingConnection> onConnected = null) { this.keyWordOut = Hash(keyWordOut ?? new byte[0]); this.ip = ip; this.port = port; this.protocol = cdp; this.connected = false; this.onConnected = onConnected; }