コード例 #1
0
        //public

        public cTcpSocketClientThread(cTcpSocketClient tssSocketClient)
        {
            //
            // Remember our parent object
            //
            SocketClient = tssSocketClient;
            encoding     = Encoding.GetEncoding("Windows-1252");
        }
コード例 #2
0
        public cTcpSocket(int iConnectionType, string sServerAddress, int iReconnectInterval,
                          bool bConnectAutomatically, int iPortNumber, int iPacketTimeout, int iWrapMethod)
        {
            ConnectionMethod = iConnectionType;
            WrapMethod       = iWrapMethod;
            PacketTimeout    = iPacketTimeout;

            switch (ConnectionMethod)
            {
            case ConnectionMethod_SocketServer:
                TcpSocketServer = new cTcpSocketServer(this, iPortNumber);
                break;

            case ConnectionMethod_SocketClient:
                TcpSocketClient = new cTcpSocketClient(this, sServerAddress, iReconnectInterval, bConnectAutomatically);
                break;

            default:
                break;
            }
        }