[zeromq-dev] creating separate independent sockets in a child process
jiun bookworm
thebookworm101 at gmail.com
Wed Apr 17 19:28:56 CEST 2013
I'm triying to create an app that one can use to interact with remote cmd
applications (on linux) and i want to use zeromq as the messaging system.
Right now my plan is to have it multi user aware by starting a new session
for requests who'se id is unknown and keep that id recorded, the new
session should be an obeject that has several properties among them being
that it connects to a port in which its parent process is listening and
receive commands and send back replies async. Ideally the same process that
started it (the child process) will listen for replies from it.
I tried to do that but i seem to be inadvertently reusing sockets across
fork boundaries, and i cant communicate with the process since there are
assertion errors that come up if i try to send a message to it.
here is some code:
http://dpaste.com/hold/1062073/
im trying to find out whether what im trying to do is possible, i.e fork a
child with and independent context+socket and communicate with it over
some port, right now im just meeting failed assertions.
How do i ensure i'm not sharing sockets with a child? or cant two different
processes read the same port concurrently? (i know they cant read same
socket so i need to find out whether thats the mistake im making and if so
where and how to correct it.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130417/020f1c02/attachment.htm>
More information about the zeromq-dev
mailing list