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,603 of 14,669   
   Jorgen Grahn to GSA   
   Re: socket-thread design issue   
   23 Sep 10 09:24:19   
   
   d93c181f   
   From: grahn+nntp@snipabacken.se   
      
   On Thu, 2010-09-23, GSA wrote:   
   > On Sep 23, 4:34 am, David Schwartz  wrote:   
   >> On Sep 22, 11:48 am, GSA  wrote:   
   >>   
   >> > I need to maintain threads as the two operations are independent. Also   
   >> > I want to keep these 2 threads running eternally.   
   >>   
   >> Maybe I'm misunderstanding. Both threads are talking to Cli and both   
   >> threads are talking to Srv. How can the two operations be independent?   
   >> If the link to Cli or Srv fails, neither thread can keep doing its   
   >> job.   
   >>   
   >> If I misunderstood and the threads don't share any sockets at all,   
   >> then if a thread loses a socket, just have it recreate that socket.   
   >>   
   >> DS   
   >   
   > I want a module which sits b/w a server and a client and passes data   
   > between them, either side to the other side.   
   > The threads do share sockets:   
   > Thread 1: SRV->Srv-Cli->CLI   
   > Thread 2: CLI->Srv-Cli->SRV   
      
   That seems awkward -- thread 1 will notice problems which only thread   
   2 can do anything about, and vice versa.   
      
   > the intermediate module has a server socket thru which it communicates   
   > with CLI and a client sock thru which it communicates with SRV in both   
   > the threads.   
      
   But once again: what problem are you trying to solve? Perhaps there is   
   a way which doesn't involve writing your own proxy.   
      
   > am highly confused on eror handling and usage of select   
   > as an alternative   
      
   I'm thinking vaguely about a design where one process   
   - keeps an uplink buffer   
   - and a downlink buffer   
   and has as its goals for each buffer   
   - to fill it as soon as possible from one socket (when select says   
     there is something there)   
   - and drain it as soon as possible into the other (when select   
     says it might be possible)   
   plus an analysis of all possible errors and what to do   
   in those cases.  And an analysis of connect/disconnect.   
      
   /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