Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Receive with timeout on Mono #160

Open
NBRizzoli opened this issue Apr 14, 2014 · 0 comments
Open

Problem with Receive with timeout on Mono #160

NBRizzoli opened this issue Apr 14, 2014 · 0 comments

Comments

@NBRizzoli
Copy link

Hi,
i've got a strange error using a Request type socket on Mono : when i use a Receive specyfing a timeout the following exception occours :

Unhandled Exception: ZeroMQ.ZmqSocketException: No such file or directory
at ZeroMQ.ZmqSocket.Receive (System.Byte[] buffer, SocketFlags flags, System.Int32& size) [0x00000] in :0
at ZeroMQ.ExecuteExtensions.WithTimeout[Byte[],SocketFlags,Int32,Byte[]](ZeroMQ.ZmqSocket socket, ZeroMQ.ThirdParamOut`4 method, System.Byte[] arg1, SocketFlags arg2, System.Int32& arg3, TimeSpan timeout) [0x00000] in :0
at ZeroMQ.ZmqSocket.Receive (System.Byte[] buffer, TimeSpan timeout, System.Int32& size) [0x00000] in :0
at ZeroMQ.SendReceiveExtensions.Receive (ZeroMQ.ZmqSocket socket, System.Text.Encoding encoding, TimeSpan timeout) [0x00000] in :0
at TestClrzmqMono.Program.Main (System.String[] args) [0x00000] in :0

The simple piece of code that give me the issue :

     using (var context = ZmqContext.Create())
     {
        using (ZmqSocket requester = context.CreateSocket(SocketType.REQ))
        {
           requester.Connect("tcp://localhost:8888");

           const string requestMessage = "Hello";
           const int requestsToSend = 10;

           for (int requestNumber = 0; requestNumber < requestsToSend; requestNumber++)
           {
              Console.WriteLine("Sending request {0}…", requestNumber);
              requester.Send(requestMessage, Encoding.Unicode);

              TimeSpan ts = new TimeSpan(0, 0, 1);
              string reply = requester.Receive(Encoding.Unicode, ts);
              Console.WriteLine("Received reply {0}: {1}", requestNumber, reply);
           }
        }
     }

On windows it works fine.
I hope someone can help me with this.

PS : with a bit of debug i've found that the exception is thrown by the following line of code :
" receiveResult = method(arg1, arg2, out arg3); "
in file ExecuteExtensions.cs, line 81.
But i can't understand why this line of code can throw a "No such file or directory"....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant