Connect() fails in worker thread??? 
Author Message
 Connect() fails in worker thread???

In my MFC application running on Win2k, the following code
fails in a worker thread, but succeeds in the main thread.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

        servaddr.sin_family = AF_INET;
        servaddr.sin_port = htons(PORT);
        servaddr.sin_addr.S_addr = IP;
        int ret = connect(sockfd, (struct sockaddr *)
&servaddr, sizeof(servaddr));
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

In the worker thread, the error is always WSAETIMEDOUT,
never succeeds! But the same code in an applicaiton running
on WinCE works well! What's wrong with it? Is there any
security issues involved?

Thanks a lot!



Mon, 02 May 2005 22:28:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ODBC database connect in a worker thread.

2. Why connect() fails in the worker thread but succeeds in the main thread?

3. emulator connect fails if not connected to internet

4. worker thread vs main thread?

5. COM Threading Model for ISAPI Worker Threads

6. Handling events from a worker thread in the main thread

7. component in main threads used in worker threads

8. Exe server threading model - events from worker thread question

9. how do i create thread safe worker thread

10. How can i terminate a Worker Thread during a Thread is running?Thank

11. How to Send messages from worker thread to main thread

12. Synchronization problem between main thread and worker thread

 

 
Powered by phpBB® Forum Software