/// <summary> /// Sends a raw appgram /// </summary> /// <param name="address">The address of the destination device</param> /// <param name="expectingReply">True if a response is expected, false otherwise</param> /// <param name="message">The header message</param> /// <param name="content">The content of the appgram</param> internal void SendRaw(Address address, bool expectingReply, IAppMessage message, BufferSegment content) { lock (_lock) { OutboundAppgram appgram = new OutboundAppgram(); appgram.Content = new AppgramContent(message, content); appgram.Destination = address; appgram.ExpectingReply = expectingReply; appgram.Priority = NetgramPriority.Normal; if (_router != null) { _router.SendAppgram(appgram); } } }
/// <summary> /// Sends an unconfirmed request /// </summary> /// <param name="destination">The destination address</param> /// <param name="expectingReply">Whether or not a response is expected</param> /// <param name="request">The unconfirmed request</param> private void _sendUnconfirmedRequest(Address destination, bool expectingReply, IUnconfirmedRequest request) { UnconfirmedRequestMessage message = new UnconfirmedRequestMessage(); message.ServiceChoice = (byte)request.ServiceChoice; byte[] raw = _saveUnconfirmedRequest(request); OutboundAppgram appgram = new OutboundAppgram(); appgram.Content = new AppgramContent(message, new BufferSegment(raw, 0, raw.Length)); appgram.Destination = destination; appgram.ExpectingReply = expectingReply; appgram.Priority = NetgramPriority.Normal; if (_router != null) { _router.SendAppgram(appgram); } }