Occurs when in sending has had a error other than disconnecting.
Event information
- C#: delegate void delegateNotifyMessageEvent(string msg, int msgId, int errCode);
event delegateNotifyMessageEvent evNotifyMessageEvent;
- Ruby: EvNotifyMessageEvent(msg, msg_id, err_code)
- Python: evNotifyMessageEvent(msg, msg_id, err_code)
Arguments
- msg: A error message.
- msgId or msg_id: A message ID that caused the error.
- errCode or err_code: A error code.
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 12 |
ClientTcpCommunication cltComm = new ClientTcpCommunication(); cltComm .evNotifyMessageEvent += new delegateNotifyMessageEvent(notifyCommunicatonMessage); //callback function private void notifyCommunicatonMessage(string msg, int msgId, int errCode) { Dispatcher.BeginInvoke(new Action(() => { //txtNotify is a TextBox control. txtNotify.Text += string.Format("Message ID[{0}], Error Code[0x{1:x2}], {2}\r\n", msgId, errCode, msg); }), DispatcherPriority.Send); } |
Ruby
1 2 3 4 5 6 7 |
//callback function notifyCommunicatonMessage = lambda{|msg, msg_id, err_code| puts("Message ID[0x%02x], Error Code[0x%02x], %s" % [msg_id, err_code, msg]) } cltComm = ClientTcpCommunication.new cltComm .EvNotifyMessageEvent= notifyCommunicatonMessage |
Python
1 2 3 4 5 6 7 |
//callback function def notify_communicaton_message(msg, msg_id, err_code) print("Message ID[0x{0:02x}], Error Code[0x{1:02x}], {2:s}".format(msg_id, err_code, msg)) } clt_comm = hz_client_tcp_communication.ClientTcpCommunication() clt_comm.evNotifyMessageEvent= notify_communicaton_message |