コード例 #1
0
        private int Timeout = 8000; //线程等待时间

        #endregion Fields

        #region Constructors

        public SyncSocketInvokeElement()
        {
            m_tcpClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            m_protocolFlag = ProtocolFlag.None;
            m_outgoingDataAssembler = new OutgoingDataAssembler();
            m_recvBuffer = new DynamicBufferManager(ProtocolConst.ReceiveBufferSize);
            m_incomingDataParser = new IncomingDataParser();
            m_sendBuffer = new DynamicBufferManager(ProtocolConst.ReceiveBufferSize);
        }
コード例 #2
0
        public AsyncSocketInvokeElement(AsyncSocketServer asyncSocketServer, AsyncSocketUserToken asyncSocketUserToken)
        {
            m_asyncSocketServer    = asyncSocketServer;
            m_asyncSocketUserToken = asyncSocketUserToken;

            m_incomingDataParser    = new IncomingDataParser();
            m_outgoingDataAssembler = new OutgoingDataAssembler();

            m_connectDateTime = DateTime.UtcNow;
            m_activeDateTime  = DateTime.UtcNow;
            m_sendAsync       = false;
        }
コード例 #3
0
        protected OutgoingDataAssembler m_outgoingDataAssembler; //协议组装器,用来组织服务端返回的命令

        public AsyncSocketInvokeElement(AsyncSocketServer asyncSocketServer, AsyncSocketUserToken asyncSocketUserToken)
        {
            m_asyncSocketServer  = asyncSocketServer;
            AsyncSocketUserToken = asyncSocketUserToken;
            NetByteOrder         = false;

            m_incomingDataParser    = new IncomingDataParser();
            m_outgoingDataAssembler = new OutgoingDataAssembler();
            m_sendAsync             = false;

            ConnectDT = DateTime.UtcNow;
            ActiveDT  = DateTime.UtcNow;
        }