/// <summary> /// Send message to server with a given header. /// </summary> /// <param name="request">Message to be sent.</param> /// <param name="header">Header to be sent.</param> private void SendWithGivenHeader(IWspInMessage request, WspMessageHeader header) { var requestBytes = Helper.ToBytes(request); var headerBytes = Helper.ToBytes(header); Array.Copy(headerBytes, requestBytes, headerBytes.Length); request.Header = header; lastRequest = request; Sender.SendMessage(requestBytes, out lastResponseBytes); }
/// <summary> /// Send message to server. /// </summary> /// <param name="request">Message to be sent.</param> public void Send(IWspInMessage request) { lastRequest = request; Sender.SendMessage(Helper.ToBytes(request), out lastResponseBytes); }