Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Multiple instances of TCP/IP stack and socket communication: (3 Items)
   
Multiple instances of TCP/IP stack and socket communication  
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  
In our help document, you can find your answer under, e.g., the "io-pkt"
entry in the utility refrence. 

If you have a process running with SOCK=/sock3 env to talk to another
process running with /sock2 env, the communication between the two
processes is the same as most network applications, i.e., through
socket() interface. However, if you are talking about other
(non-socket()) ways of communication (e.g. share memory), you certainly
can treat them as two local processes: as long as you don't touch the
libsocket there. 
 
Thanks
Weijie


-----Original Message-----
From: C.yin Lee [mailto:community-noreply@qnx.com] 
Sent: March 6, 2009 2:54 PM
To: technology-networking
Subject: Multiple instances of TCP/IP stack and socket communication

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/post23823
RE: Multiple instances of TCP/IP stack and socket communication  
This is in the official QNX documentation 

http://www.qnx.com/developers/docs/6.4.0/neutrino/user_guide/tcpip.html

See "Running multiple instances of the TCP/IP stack"

What this does is tell libsocket which entry to open when it tries to
attach to the resource manager registered by the stack, so the short
answer is that nothing else needs to get done other than properly
specifying the SOCK var.

I'm not sure that I understand your comment about SOCK/sock2
communicating with SOCK=/sock3.  Normally, you'd use different stack
instantiations for something like allowing re-use of IP addresses or
preventing intermixing of traffic flows on different hardware
interfaces.  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.  

If you're talking about remote machines, as long as the two stacks share
connectivity (i.e. an interface belonging to each stack sits on the same
subnet), then things will work fine.

	R.


-----Original Message-----
From: C.yin Lee [mailto:community-noreply@qnx.com] 
Sent: Friday, March 06, 2009 2:54 PM
To: technology-networking
Subject: Multiple instances of TCP/IP stack and socket communication

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/post23823