I started mucking around with the code in mailbox::send() to fix the assertion 
that OSX users (like me) oftentimes get in high-volume situations.

For one, getsockopt() returns 0 on OSX! So the line to expand the SNDBUF 
doesn't work:

  new_sndbuf = old_sndbuf * 2;

Obviously, 0 times anything is 0 so the expansion fails.

The other weird thing on OSX is that when getsockopt() does return a valid 
value, it's in kilobytes instead of bytes. That is, it will return 32 when it 
should return 32768.

So I rewrote the logic to expand the buffer like so:

  new_sndbuf = (old_sndbuf == 0) ? 32768 : (old_sndbuf * 2048);

It works. I no longer get the assertion.

However, that code will likely break horribly on linux. 

Comments?

cr
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to