Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - setevn and clearenv - how efficient are they?: (2 Items)
   
setevn and clearenv - how efficient are they?  
Hi,

I have a QNX 6.4.1 system with a two-stack io-pkt network manager. In one of my applications, there is a need to 
communicate packets between both stacks. I wanted to know what would be the best and most efficient way to switch 
between stacks.

Currently, I do have a solution - I use the setevn() and clearenv() calls to set and reset the "SOCK" environmental 
variable so that I am looking at the correct stack. However, this means that every time there is a packet to be 
transmitted, I have to use the setenv() and clearenv() calls to make sure that I am transmitting to the right stack. I 
am worried if these setenv() and clearenv() take too much time or resources to do what they do.

Any info would be appreciated

Regards
Sunil
Re: setevn and clearenv - how efficient are they?  
On Mon, May 03, 2010 at 06:11:57AM -0400, Sunil Keshava wrote:
> Hi,
> 
> I have a QNX 6.4.1 system with a two-stack io-pkt network manager. In one of my applications, there is a need to 
communicate packets between both stacks. I wanted to know what would be the best and most efficient way to switch 
between stacks.
> 
> Currently, I do have a solution - I use the setevn() and clearenv() calls to set and reset the "SOCK" environmental 
variable so that I am looking at the correct stack. However, this means that every time there is a packet to be 
transmitted, I have to use the setenv() and clearenv() calls to make sure that I am transmitting to the right stack. I 
am worried if these setenv() and clearenv() take too much time or resources to do what they do.
> 

Check out these two threads for ideas on targeting specific stacks
without the env twiddling.

http://community.qnx.com/sf/discussion/do/listPosts/projects.core_os/discussion.newcode.topc4724
http://community.qnx.com/sf/discussion/do/listPosts/projects.networking/discussion.general.topc5424

Regards,

-seanb