[zeromq-dev] exception thrown on socket recieve function call in c# interop bindings
Johnny Gozde
johnny at jgoz.net
Fri Feb 10 21:59:42 CET 2012
On Fri, Feb 10, 2012 at 12:37 PM, David Starkweather <starkd88 at gmail.com>wrote:
> The only program that uses this header is the second program (the response
> code.) the exception is occuring in the c# program (the requester).
>
A few more questions:
1) What version(s) of libzmq are you using, both in C# and C?
2) In the C# code, why are you using pinned GCHandles and Marshal.Copy to
convert your hash code to a byte array (lines 34-39)? This isn't
necessarily related to your problem, but you'd be much better off using
Buffer.BlockCopy (
http://msdn.microsoft.com/en-us/library/system.buffer.blockcopy.aspx).
Pinned GCHandles are evil for a lot of reasons and, as far as I can tell,
don't need to be used in this situation.
3) In C#, are you using non-blocking Sends on purpose? This shouldn't make
a difference, but you don't have a retry mechanism for failed sends, so you
should probably be using blocking sends.
These may not be related to your problem, but it's a start...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120210/2ba873f5/attachment.htm>
More information about the zeromq-dev
mailing list