home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,601 of 14,669   
   Jorgen Grahn to GSA   
   Re: socket-thread design issue   
   22 Sep 10 19:03:34   
   
   06d591fc   
   From: grahn+nntp@snipabacken.se   
      
   On Wed, 2010-09-22, GSA wrote:   
   > On Sep 22, 7:04 pm, David Schwartz  wrote:   
   >> On Sep 22, 5:30 am, GSA  wrote:   
   >>   
   >> > Please let me know where I can insert the accept and connect again in   
   >> > the threads and resend/re-receive so that it works fine. I have tried   
   >> > various options in vain.   
   >>   
   >> You don't want to do it in the threads. Just make your whole 'main'   
   >> function a loop.   
   >>   
   >> If you want to form two new connections when either one fails, then if   
   >> one connection fails, call 'shutdown' on the other. That will ensure   
   >> that both threads terminate.   
   >>   
   >> DS   
   >   
   > I need to maintain threads as the two operations are independent. Also   
   > I want to keep these 2 threads running eternally.   
      
   I'm not sure DS argued against threads above ...   
      
   But he could have: you do not /need/ threads in order to handle more   
   than one socket. You can use select and nonblocking sockets, for   
   example.   
      
   Is this an exercise, or do you need this program for some purpose? It   
   seems very unusual to have a client, a server and a middleman.  Is it   
   some kind of proxy? You can use e.g. ssh to get standard, safe and   
   reliable tunneling for most purposes, without writing anything.   
      
   (Note that I haven't read the code -- I got distracted by the broken   
   formatting ... and the unfortunate identifier "clitoSrv".)   
      
   /Jorgen   
      
   --   
     // Jorgen Grahn    O  o   .   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca