/// <summary> /// Initializes a new instance of <see cref="SimpleClientTcpSocket"/>. /// </summary> public SimpleClientTcpSocket() { // Create the underlying socket and hook up its Connect event. Socket = new ClientTcpSocket(); Socket.ConnectCompleted += SocketConnectCompleted; // Create the receive buffer for the socket. Packetizer = new SocketPacketProtocol(Socket); // Initialize the keepalive timer and its default value. KeepaliveTimer = new Timer(); KeepaliveTimer.Elapsed += KeepaliveTimerTimeout; KeepaliveTimer.Interval = TimeSpan.FromSeconds(5); }