You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to send XML through XElement and use this code:
XElement xml = new XElement("msg");
using (var sendFrame = new ZFrame())
{
xml.Save(sendFrame);
socket.SendFrame(sendFrame);
}
However, I get the error (on line xml.Save):
System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'
The only way to create ZFrame is to pass my message into ZFrame's constructor. Instead of direct writing to ZFrame, I now have to do extra allocations: 1) pass a string - allocating string; 2) pass a byte[] - allocating array.
I have checked that ZFrame allows writes to stream (CanWrite = True). Could you spot a light why it's not possible to directly write to ZFrame?
The text was updated successfully, but these errors were encountered:
I want to send XML through XElement and use this code:
However, I get the error (on line xml.Save):
The only way to create
ZFrame
is to pass my message intoZFrame
's constructor. Instead of direct writing toZFrame
, I now have to do extra allocations: 1) pass astring
- allocating string; 2) pass abyte[]
- allocating array.I have checked that
ZFrame
allows writes to stream (CanWrite = True
). Could you spot a light why it's not possible to directly write toZFrame
?The text was updated successfully, but these errors were encountered: