Exemple #1
0
        private void Send(StateObject stateObject)
        {
            TransferObject to     = stateObject.transferObject;
            Socket         client = stateObject.workSocket;

            byte[] sendData = TransferUtil.transferObjectToByteArray(to);

            client.Send(sendData);
        }
        private void Send(StateObject stateObject)
        {
            TransferObject to     = stateObject.transferObject;
            Socket         socket = stateObject.workSocket;

            byte[] sendData = TransferUtil.transferObjectToByteArray(to);

            //socket.Send(sendData);

            // Begin sending the data to the remote device.
            socket.BeginSend(sendData, 0, sendData.Length, SocketFlags.None, new AsyncCallback(SendCallback), socket);
        }