通信中に何らかの要因で切断を行う場合または、通信停止通知メッセージの受信時に発生する。
Event information
- C#: delegate void delegateNotifyReceivedDisConnectEvent(string msg, int status);
event delegateNotifyReceivedDisConnectEvent evNotifyReceivedDisConnectEvent;
- Ruby: EvNotifyReceivedDisConnectEvent(msg, status)
- Python: evNotifyReceivedDisConnectEvent(msg, status)
Arguments
- msg: 通信切断メッセージ
- status: ステータスコード(0: OK, other than 0: failed for some reason.)
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 |
ClientTcpCommunication cltComm = new ClientTcpCommunication(); cltComm .evNotifyReceivedDisConnectEvent += new delegateNotifyReceivedDisConnectEvent(notifyReceivedDisconnect); //callback function private void notifyReceivedDisconnect(string msg, int st) { Dispatcher.BeginInvoke(new Action(() => { //txtNotify is a TextBox control. txtNotify.Text += string.Format("{0}, Status[0x{1:x2}]\r\n", msg, st); }), DispatcherPriority.Send); } |
Ruby
1 2 3 4 5 6 7 |
//callback function notifyReceivedDisconnect = lambda{|msg, st| puts("{%s}, Status[0x%02x]" % [msg, st]) } cltComm = ClientTcpCommunication.new cltComm .EvNotifyReceivedDisConnectEvent = notifyReceivedDisconnect |
Python
1 2 3 4 5 6 |
//callback function def rcv_notify_received_disconnect(msg, st) print("{0:s}:Status[0x{1:02x}]".format(msg, st)) clt_comm = hz_client_tcp_communication.ClientTcpCommunication() clt_comm.evNotifyReceivedDisConnectEvent = rcv_notify_received_disconnect |