Comments (6)
FYI I have just had the problem occur with nng_msleep(1)
as well, so evidently this isn't quite enough to work-around this problem.
from nng.
Yeah, I'd guess msleep 10 would be better. :-)
Due to the way Windows IPC works, there are some asynchronicity things going on under the hood that make it hard to be fully synchronous. TCP (and IPC on UNIX systems) doesn't suffer this.
I'll look again to see if there are things I can do to make this better. The entire IPC mechanism for Windows is a strange beast, as it is entirely unlike UNIX domain sockets.
from nng.
dial also always runs more or less asynchronously, even on TCP and UNIX sockets -- because of the way NNG is architected. There isn't really a great solution to this, as at present there is no two-way handshake. We could add a complete two way handshake, but that would make the setup take a little longer, and it would break compatibility (which is the real reason we haven't done it yet).
from nng.
It is perhaps an unusual situation where it is desirable to have complete synchronization for the dial operation, however, if it's possible to implement a complete two way handshake perhaps we could avoid breaking compatibility by only doing this if a different flag is passed to the dial function?
from nng.
The problem is that any way you do it, you have to implement changes to the wire protocol.
I want to fix this someday, but it requires a protocol update. Not going to happen this week. :-). And probably not the next either. :-)
It is possible to implement this synchronization in your application protocol btw. I just can't do it at the NNG / SP protocol without breaking compatibility for other SP applications.
from nng.
I'm going to close this for now. It's not something I'm going to do until I refactor the entire wire protocol.
from nng.
Related Issues (20)
- If I understand correctly, NNG's REP is analog to ROUTER when in raw mode or using a context object for asynchronous operations. REQ is similarly analog to DEALER when in raw mode or using a context object. So these socket types are unnecessary... I presume that the same reasoning applies to the lack of XPUB/XSUB in NNG. HOT 1
- Replace ZMQ(router/dealer) to NNG in raw mode problem HOT 1
- [Question] How to pass a value or datas in the callback function of nng_aio_alloc?
- Your text about Russia/Ukraine (typo) HOT 1
- Websocket masking could a lot faster
- IPC socket could support setting ownership HOT 1
- Missing Header in posix_rand_getrandom.c
- nng_msg_insert: munmap_chunk(): invalid pointer HOT 3
- Deadlock during nng_close() - multi platform HOT 23
- Sendmsg Thread Blocking HOT 3
- How to create a new language binding using a binary/dll? HOT 1
- Compiler warnings / errors from new logging feature on Windows HOT 2
- Windows a deadlock on `nng_close()` HOT 13
- mqttv5_client chokes on CONNACK packet HOT 2
- setting NNG_OPT_TLS_CONFIG on socket should hold reference HOT 6
- Memory Leak in nng_rep0_open HOT 2
- IPC - Use After Free HOT 4
- Will the NNG framework built-in handle packet splitting and sticking issues during streaming transmission? HOT 2
- Tools or API could obtain all communication endpoint information for establishing communication with this machine HOT 2
- nng_socket_set_ms didn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nng.