コード例 #1
0
        /// <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);
        }
コード例 #2
0
ファイル: SimpleSockets.cs プロジェクト: GotAudio/ModbusExcel
        /// <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);
        }