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
REQREP: How to really have multiple server instances? #271
Comments
May be this might be useful for you, Note: IPC didn't worked, TCP worked. On Sunday, June 29, 2014, metadings notifications@github.com wrote:
|
Messing with Google I found three pastes, but they are full of "I tried here and I'm waiting forever there". http://pastebin.com/rqpdaQmH "nanomsg REP/REQ example with threads" Which do you refer to? |
It's weird trying to bind and connect around. It should be easier. Wait: I'm really impressed how easy it was to compile nanomsg-0.4-beta (sadly I'm just on Win x86)! I'm now going to bind myself on a walk around the city, I hope someone starts a connect. ARGH |
Out of the four one is client code [ http://pastebin.com/GQq6vPkX ] and Use the latest one [http://pastebin.com/rqpdaQmH], and as I mentioned IPC On Sun, Jun 29, 2014 at 8:27 PM, metadings notifications@github.com wrote:
|
I have to mention that using "nn_device" was easy but due to some issues on Logically "nn_device" should be bind to the end-points. Client and Server I hope this will help the comment in the sample code which confuses others. On Sun, Jun 29, 2014 at 9:56 PM, Ramakrishna Mallireddy <
|
No it just keeps confusing, weird and annoying. Has anyone a working example of multiple worker threads REPlying on multiple REQuest threads? |
please ignore the comments completely and just see the code and replace ipc I have an oauth2 service running with the same code, as I don't want to If you still confuse i.e even after removing comments from the code, then I On Sun, Jun 29, 2014 at 11:20 PM, metadings notifications@github.com
|
Ok, I have updated the example, On Sun, Jun 29, 2014 at 11:49 PM, Ramakrishna Mallireddy <
|
Yeah, also had some issues because of MemoryStream Seek, WriteTo, Flush and Close resulting in nonsense exceptions. Now it's doing a good job, so far I can see. Thanks for your help! It is now as follows:
A bit of confusing is also the difference in (NNanomsg) SendStream/SendStreamImmediate and ReceiveStream/ReceiveStreamImmediate: The *Immediate methods are using NN_DONTWAIT, and I ended up using these methods inside of polling callbacks (receiving the REQuest, receiving the REPly), and the non-Immediate methods when I'm sending the REQuest, sending the REPly. Now I'm just missing a nn_device which takes a timeout, so I can poll and break without having to kill it using NN.Term. Also have a look for the example: mhowlett/NNanomsg#14 (comment) |
The examples I found on the internet always have one instance to REPly on REQuests. When I tried an example (sorry not pure C, but C#) and I spawn more than 1 reply server, there is always the
Address in use [100] (transports\tcp\btcp.c:378)
(currently have a nanomsg build 0.3-beta). I also tried to use a mutex, released directly after ReceiveStream but this results in the same error.How to have multiple reply services, which bind to the same port for requests, but "accept" and work to reply on another port (so that while working, the next worker can pickup following requests)?
The text was updated successfully, but these errors were encountered: