Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Re: Multiple instances of TCP/IP stack and socket communication: (2 Items)
   
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?

Thanks
Cheng-Yin

On Fri, Mar 6, 2009 at 2:53 PM, Yin Lee <c.yin.lee@gmail.com> wrote:

> Hello,
>
> 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 information.
> 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 processes (e.g.
> 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?
>
>
>
> Thanks
>
> Cheng-Yin
>
RE: Multiple instances of TCP/IP stack and socket communication  
Hi:
	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
stack instantiation. 

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.

	Robert.


-----Original Message-----
From: C.yin Lee [mailto:community-noreply@qnx.com] 
Sent: Monday, March 09, 2009 3:21 PM
To: technology-networking
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?

Thanks
Cheng-Yin

On Fri, Mar 6, 2009 at 2:53 PM, Yin Lee <c.yin.lee@gmail.com> wrote:

> Hello,
>
> 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
information.
> 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
processes (e.g.
> 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?
>
>
>
> Thanks
>
> Cheng-Yin
>


_______________________________________________
Technology
http://community.qnx.com/sf/go/post23953