Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Image List and List control Pin
Bill Wilson14-Aug-02 6:52
Bill Wilson14-Aug-02 6:52 
GeneralRe: Image List and List control Pin
krisn14-Aug-02 7:40
krisn14-Aug-02 7:40 
GeneralDocument telling DialogBar to Update Pin
JennyP13-Aug-02 10:05
JennyP13-Aug-02 10:05 
GeneralRe: Document telling DialogBar to Update Pin
Tomasz Sowinski13-Aug-02 10:09
Tomasz Sowinski13-Aug-02 10:09 
GeneralRe: Document telling DialogBar to Update Pin
Ernest Laurentin13-Aug-02 10:51
Ernest Laurentin13-Aug-02 10:51 
GeneralBringing another application to the front Pin
Dean Michaud13-Aug-02 9:57
Dean Michaud13-Aug-02 9:57 
GeneralRe: Bringing another application to the front Pin
567890123413-Aug-02 21:11
567890123413-Aug-02 21:11 
GeneralCan't terminate network thread. Pin
JohnnyG13-Aug-02 9:54
JohnnyG13-Aug-02 9:54 
I've got a thread to receive data from the network using Winsock 1.1. In the thread is a while loop which waits for single object for the thread exit event which is used to shut down all threads in the app. That works fine for the other threads.

Of course, I do a WaitForSingleObject with timeout set to zero so that I don't take significant time in waiting for a thread exit (stop) event. Then this WaitFor is followed by a recvfrom() which of course is blocking.

I know what is happening. I am sending the terminate event when the thread is waiting/blocking for data to be received from the network and so it doesn't see it.

I think I know one solution but was wondering if you guys knew another. The solution I know would be to use Winsock 2.0 and set socket options via setsockopt() with the SO_RCVTIMEO (receive timeout set to zero or non-blocking). Actually, I now noticed that using "select" you can pass a timeval structure for timeouts too. Is that the only ways I can accomplish this or is there another way to shutdown this thread gracefully for Winsock 1.1? I'm also not sure that if I go that route whether I have to worry about some sort of overlapped programming or not.
GeneralRe: Can't terminate network thread. Pin
Ernest Laurentin13-Aug-02 11:08
Ernest Laurentin13-Aug-02 11:08 
GeneralRe: Can't terminate network thread. Pin
JT Anderson13-Aug-02 11:09
JT Anderson13-Aug-02 11:09 
GeneralRe: Can't terminate network thread. Pin
JohnnyG13-Aug-02 15:36
JohnnyG13-Aug-02 15:36 
Generallink error Pin
RocardoS13-Aug-02 9:37
sussRocardoS13-Aug-02 9:37 
GeneralRe: link error Pin
Tomasz Sowinski13-Aug-02 9:40
Tomasz Sowinski13-Aug-02 9:40 
GeneralRe: link error Pin
RocardoS13-Aug-02 9:56
sussRocardoS13-Aug-02 9:56 
GeneralRe: link error Pin
Tomasz Sowinski13-Aug-02 10:01
Tomasz Sowinski13-Aug-02 10:01 
GeneralRe: link error Pin
RocardoS13-Aug-02 10:16
sussRocardoS13-Aug-02 10:16 
Generalmultiple recordsets Pin
danag13-Aug-02 9:30
danag13-Aug-02 9:30 
GeneralRe: multiple recordsets Pin
Bill Wilson13-Aug-02 13:09
Bill Wilson13-Aug-02 13:09 
GeneralRe: multiple recordsets Pin
danag13-Aug-02 13:35
danag13-Aug-02 13:35 
GeneralRe: multiple recordsets Pin
Alexander Wiseman13-Aug-02 14:54
Alexander Wiseman13-Aug-02 14:54 
Generalmodeless dialog-Resizing Pin
udayGovekar13-Aug-02 9:23
udayGovekar13-Aug-02 9:23 
GeneralRe: modeless dialog-Resizing Pin
Tomasz Sowinski13-Aug-02 9:26
Tomasz Sowinski13-Aug-02 9:26 
QuestionHow do i use acmFormatEnum? All help is appreciated! Pin
redeemer13-Aug-02 9:10
redeemer13-Aug-02 9:10 
AnswerRe: How do i use acmFormatEnum? All help is appreciated! Pin
Ernest Laurentin13-Aug-02 10:46
Ernest Laurentin13-Aug-02 10:46 
AnswerRe: How do i use acmFormatEnum? All help is appreciated! Pin
Ernest Laurentin14-Aug-02 17:40
Ernest Laurentin14-Aug-02 17:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.