Can I use the socket that i created in one execution instance to communicate for the other execution instances
IMO it is not possible/not recommended for processes to share same socket handle(single IP and PORT)
Even though you try that, all instances writing to the same socket will be a mess; unless every request/response has a identification mechanism of itself(like sequence number).
but your problem can be solved using other ways.
if you really want to use only one socket, have one dedicated program for socket connection in the client side(which would always be running) which sends and receives data from server, all other your IVR instances can use a Message queue or a shared memory mechanism to connect with this dedicated socket program to send/receive data.
The above idea brings more complexity to your code, you have to craft it properly. But one common solution is, let all the instances create its own socket, the memory that is going to be used for socket creation is very minimum, the number of socket connections per system also can be tuned(increased/decreased).
Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
| [reply] |
Yep I understood thanks a lot...
| [reply] |
It is better you can call the function for creating a socket at once in the initial part. After that you can send and receive a message using that socket descriptor. If you want more please put your code. | [reply] |