[nanomsg] Re: Framing - separation of multiple parts of the message

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Sat, 23 Nov 2013 10:56:58 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Steve,

> One place where it'd be useful is where you want to use it for
> routing information. Cracking open a big protobuf or msgpack
> payload just to find out where it should be sent to is a fair bit
> of overhead.
> 
> The extreme of that is pub/sub - you can't send packed messages
> over pub/sub and use subscriptions without adding some sort of
> basic framing (or getting *way* too chummy with the packing format
> in use).

Yes, this was already discussed in the past.

PUB/SUB should separate topic and body of the message. The real reason
has to do with encryption (so that message body can be encrypted and
intermediary nodes are still able to route messages), but it also has
it's implications. My thinking at the moment is passing the topic as
ancillary data to nn_sndmsg() and also providing a helper function to
keep it easy for the users:

nn_pub_send (s, char *topic, size_t topic_len, char *buf, size_t len,
int flags);

Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSkHvqAAoJENTpVjxCNN9YVo0H/3gavp56BD+sC0jcdnxGb/Hb
zTvuxhXVb3TWmECji2BwDEv8DUID4I6E1fFMqY2a1ekBF6c8rQI54z0KP1uajB4z
4ydVfiOTapVYYc7ZQ2VVDor7M5ucelO2GdFcJEqaswOr96bcqkolqTieBCNYPu1Y
WTCi0fTOakvt4TQIB3DIaFCEPETd7xW282zOwdssL3sDqhMWg7MuNzmi/eOhz063
lJZHlNIL2ba9tD41vXhqshyAmDoK5WGJNrhBDs4EvKXsvdzAE2J5mxjex9lVaxt3
AKQl78N8x/iO2wxeuWNhvUfnK2IQLwPA+dBxbYLWuH9FsbbCUjDvUtT7SLVDgHU=
=UNKf
-----END PGP SIGNATURE-----

Other related posts: