public static void SendOneWay(this IOutputChannel outputChannel, OneWayMessage message) { using (var context = outputChannel.BeginReadWrite()) { context.Write(message.ToFrame()); } }
public static Message SendAndReceive(this IOutputChannel outputChannel, OneWayMessage message) { try { IFrame response; using (var context = outputChannel.BeginReadWrite()) { context.Write(message.ToFrame()); response = context.Read(); } return(Message.Create(response)); } catch (Exception e) { throw new IOException("Connection failed. Check that server is still alive", e); } }