03/09/2009 3:39 PM
RE: Multiple instances of TCP/IP stack and socket communication
With regards to your sock2 / sock3 example, unless the two
stacks share a common IP interface, there is no way for the two
processes to communicate with one another. When you think about it,
the sock2 / sock3 prefix simply lets the application talk to a specific
App1 -> libsocket (sock2) -> Stack (sock2)
App2 -> libsocket (sock3) -> Stack (sock3)
If Stack (sock2) isn't connected to Stack (sock3) at the IP layer, then
there is no way for app1 and app2 to communicate with one another. The
only way that stack (sock2) can communicate with stack (sock3) is if
they share a common IP network connection.
From: C.yin Lee [mailto:email@example.com]
Sent: Monday, March 09, 2009 3:21 PM
Subject: Re: Multiple instances of TCP/IP stack and socket communication
Thanks Weijie and Robert for your responses.
If a process X started on SOCK=/sock2, wants to talk to another process
Y started on SOCK=/sock3, how can process X talk to process Y using
socket communication. As I understand process X can only send messages
to processes with environment var SOCK=/sock2 (unless the environment
variable is changed in process X to SOCK=/sock 3 before using socket
comm to process Y and then change back to SOCK=/sock2 before using sock
communication to other process started on SOCK=/sock2) , but they should
be better ways of doing this.
Regarding Robert's question:
"To get these two stacks to talk to one another using IP,
there'd have to be a common IP interface between them and this normally
doesn't happen when you have two different stacks instantiated on the
same machine (which is what I assume you are talking about), so I'd have
to see exactly what sort of configuration you were thinking of before
commenting on if it's possible. "
Process X (sock2) wants to another process Y (sock3) on the same
machine, using socket communication. Is this not feasible?
On Fri, Mar 6, 2009 at 2:53 PM, Yin Lee <firstname.lastname@example.org> wrote:
> If a SOCK environment variable is set to the same "prefix" name used
> to start a TCP/IP stack, then:
> From a FAQ in QNX developer web site "The SOCK environment variable is
> set so that QNX libsocket can identify which stack instance to use"
> I cannot find any other official QNX document validating this
> Can someone please confirm this or point to more detailed information
> on how the SOCK environment variable is used within QNX, and if there
> are any caveats to this.
> Also I would like to confirm that a socket in a process (e.g. telnet
> client) started using a specific SOCK environment will communicate
> with another socket in a process (e.g. telnetd) started using the
> same SOCK environment variable, and no code changes is required in the
> telnet and telnetd), and no other parameters, or functions need to be
> set for this to happen.
> If for some reason, a process started on SOCK=/sock2, wants to talk
> to another process started on SOCK=/sock3, what is the recommended way
> of doing this?