Esempio n. 1
0
        public CruNetworkClient(string address = null, int port = 0)
        {
            _ip   = address;
            _port = port;

            _receiveQueue    = new CruMessageQueue(100);
            _messageTransfer = new CruMessageTransfer();

            Init();
        }
Esempio n. 2
0
        public ClientData_Async(Socket socket, SocketAsyncEventArgs receiveEvent, SocketAsyncEventArgs sendEvent)
        {
            _client        = socket;
            _sendBuffer    = new byte[1024];
            _receiveBuffer = new byte[1024];

            _receiveEvent = receiveEvent;
            _sendEvent    = sendEvent;

            _sendQueue = new CruMessageQueue(10);

            _transfer            = new CruMessageTransfer();
            _receiveEventControl = new AutoResetEvent(false);
            _sendEventControl    = new AutoResetEvent(false);
        }
Esempio n. 3
0
        public ClientManager(int capacity, int emptyPoolCnt)
        {
            _capacity = capacity;

            _clientList      = new List <ClientData>();
            _clientPool      = new ClientDataPool(capacity);
            _messageTransfer = new CruMessageTransfer();
            _sendQueue       = new CruMessageQueue(capacity);
            _receiveQueue    = new CruMessageQueue(capacity);
            _sendDataBuffer  = new byte[1024];
            _clientPool.SetEmptyData(emptyPoolCnt);   // Pool 미리 생성

            // Event 추가
            receiveCompleteEvent += PushReceiveData;
            disConnectEvent      += DisConnectClient;
        }
Esempio n. 4
0
        public ClientData(Socket socket, int clientNum)
        {
            _client          = socket;
            _clientNum       = clientNum;
            _unicastBuffer   = new byte[1024];
            _sendBuffer      = new byte[1024];
            _receiveBuffer   = new byte[1024];
            _unicastDataSize = 0;
            _sendDataSize    = 0;
            _sendDataCount   = 0;
            _receiveDataSize = 0;
            _headSize        = CruNetworkProtocol.Head.HEADSIZE_DATACOUNT;

            _isConnect = false;

            _sendQueue = new CruMessageQueue(10);

            _transfer            = new CruMessageTransfer();
            _receiveEventControl = new AutoResetEvent(false);
            _sendEventControl    = new AutoResetEvent(false);
        }