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,835 of 14,669   
   Jorgen Grahn to Marco Peng   
   Re: thread blocked while deleting a sock   
   27 Feb 12 21:10:24   
   
   feba8af7   
   From: grahn+nntp@snipabacken.se   
      
   On Mon, 2012-02-27, Marco Peng wrote:   
   > Hello to all,   
   >   
   > I have below function, but the thread will be bloked at the line   
   >     delete pListenSocket; // Close and delete   
   >   
   > If I put some cpu timing switching function prior to it, then no   
   > blocking pop up.   
   >     printf("xyz\n");  // or sleep(100);   
   >     delete pListenSocket; // Close and delete   
   >   
   > Can I get some help from any one? Thanks a lot!   
   >   
   > the function   
   > int Socketpair (int domain, int type, int protocol, Socket **   
   > ppReadSocket, Socket ** ppWriteSocket)   
   > {   
   > 	Socket * pListenSocket = NULL;   
   > 	Socket * pConnectSocket = NULL;   
   > 	Socket * pAcceptSocket = NULL;   
   ...   
      
   Noone can help you without somehow knowing what a Socket is. You   
   appear to use some C++ library which wraps your file descriptors and   
   possibly other things as C++ objects.   
      
   (And the library doesn't seem very good. I'm a C++ guy myself, but I   
   believe wrapping sockets in objects, virtual inheritance, factories   
   and pointers looks attractive at first, but eventually it's a bad   
   idea.)   
      
   Try running strace or whatever your OS supplies, and see what your   
   program really is doing when it gets stuck.   
      
   /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