void client_ReceiveMessageEvent(SocketServerLib.SocketHandler.AbstractTcpSocketClientHandler handler, SocketServerLib.Message.AbstractMessage message)
        {
            BasicMessage receivedMessage = (BasicMessage)message;

            byte[] buffer = receivedMessage.GetBuffer();
            string s      = System.Text.ASCIIEncoding.Unicode.GetString(buffer);

            this.SetReceivedText(s);
        }
Beispiel #2
0
        void server_ReceiveMessageEvent(SocketServerLib.SocketHandler.AbstractTcpSocketClientHandler handler, SocketServerLib.Message.AbstractMessage message)
        {
            BasicMessage receivedMessage = (BasicMessage)message;

            byte[] buffer = receivedMessage.GetBuffer();
            if (buffer.Length > 1000)
            {
                MessageBox.Show(string.Format("Received a long message of {0} bytes", receivedMessage.MessageLength), "Socket Server",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            string s = System.Text.ASCIIEncoding.Unicode.GetString(buffer);

            this.SetReceivedText(s);
        }
Beispiel #3
0
 void _Client_DataReceived(SocketServerLib.SocketHandler.AbstractTcpSocketClientHandler handler, SocketServerLib.Message.AbstractMessage message)
 {
     if (DataReceived != null)
     {
         BasicMessage receivedMessage = (BasicMessage)message;
         DataReceived(receivedMessage.ClientUID, receivedMessage.GetBuffer());
     }
 }
Beispiel #4
0
 void Server_DataReceived(SocketServerLib.SocketHandler.AbstractTcpSocketClientHandler handler, SocketServerLib.Message.AbstractMessage message)
 {
     if (DataReceived != null)
     {
         DataReceived(handler.GetHashCode().ToString(), message.GetBuffer());
     }
 }