/// <summary> /// Send an AnpMsg. This method blocks if a message is currently being /// transferred. /// </summary> /// <param name="msg"></param> public void SendMsg(AnpMsg msg) { Debug.Assert(transport.isReceiving || transport.doneReceiving); while (transport.isSending) { SelectSockets select = new SelectSockets(); transport.doXfer(); UpdateSelect(select); if (transport.isSending) { select.Select(); } } transport.sendMsg(msg); transport.doXfer(); }
/// <summary> /// Send a message on the tunnel. /// </summary> protected void SendAnpMsg(AnpMsg m) { AnpTransport transfer = InternalAnpTunnel.GetTransport(); Debug.Assert(transfer.isReceiving || transfer.doneReceiving); Debug.Assert(!transfer.isSending); transfer.sendMsg(m); while (transfer.isSending) { transfer.doXfer(); if (transfer.isSending) { SelectSockets set = new SelectSockets(); InternalAnpTunnel.UpdateSelect(set); Block(set); } } }