Click here to Skip to main content
15,916,398 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problems with accessing a control from another class Pin
Mazdak8-Apr-02 4:06
Mazdak8-Apr-02 4:06 
GeneralRe: Problems with accessing a control from another class Pin
James P8-Apr-02 5:31
James P8-Apr-02 5:31 
GeneralRe: Problems with accessing a control from another class Pin
Mazdak8-Apr-02 6:02
Mazdak8-Apr-02 6:02 
Generallisten() problem Pin
lucy8-Apr-02 3:21
lucy8-Apr-02 3:21 
GeneralRe: listen() problem Pin
Bob Groves8-Apr-02 9:15
Bob Groves8-Apr-02 9:15 
GeneralRe: listen() problem Pin
lucy9-Apr-02 4:05
lucy9-Apr-02 4:05 
GeneralRe: listen() problem Pin
Bob Groves9-Apr-02 4:08
Bob Groves9-Apr-02 4:08 
GeneralRe: listen() problem Pin
lucy9-Apr-02 5:20
lucy9-Apr-02 5:20 
Bob Groves wrote:
Bob/Rob are both short forms of Robert.

I see. there are so many short forms of English name.

Yeah, I did the same thing as you suggested. The code is :
SOCKET listenSocket;
listen(listenSocket, 1);

while(1)
{
BuildSelectList();
select(HighSocket+1, &ReadSet, NULL, NULL, &timeout);
if ( FD_ISSET(ListenSocket, &ReadSet) )
   HandleNewConnection();
else if ( FD_ISSET(ClientSocket, &ReadSet) )
   ReadSocket(ClientSocket);
}

in HandleNewConnection():
int newSd;
if ( ClientSocket != 0 )
{
    newSd = accept(ListenSocket, NULL, NULL);
    shutdown(newSd, 2);
    close(newSd);
    return;
}


although I closed the second connection, the client running on Windows 2000 didn't receive any error message from its call of connect(). what should I do?
GeneralRe: listen() problem Pin
Bob Groves9-Apr-02 6:01
Bob Groves9-Apr-02 6:01 
GeneralRe: listen() problem Pin
lucy9-Apr-02 7:17
lucy9-Apr-02 7:17 
GeneralRe: listen() problem Pin
Bob Groves9-Apr-02 22:20
Bob Groves9-Apr-02 22:20 
GeneralRe: listen() problem Pin
lucy10-Apr-02 3:05
lucy10-Apr-02 3:05 
Generalheader file used to access database in C++ Pin
tongc8-Apr-02 2:53
tongc8-Apr-02 2:53 
GeneralRe: header file used to access database in C++ Pin
Christian Graus8-Apr-02 3:00
protectorChristian Graus8-Apr-02 3:00 
GeneralRe: header file used to access database in C++ Pin
tongc8-Apr-02 3:07
tongc8-Apr-02 3:07 
GeneralCEdit Text Alignment Pin
Alex Deem8-Apr-02 2:37
Alex Deem8-Apr-02 2:37 
GeneralScroll bar in TreeCtrl Pin
8-Apr-02 2:33
suss8-Apr-02 2:33 
QuestionWhere comes the prerolling filter? Pin
Lizp8-Apr-02 2:13
Lizp8-Apr-02 2:13 
QuestionHow to get system color? Pin
Feng Qin8-Apr-02 1:30
Feng Qin8-Apr-02 1:30 
AnswerRe: How to get system color? Pin
8-Apr-02 1:44
suss8-Apr-02 1:44 
GeneralRe: How to get system color? Pin
Feng Qin8-Apr-02 1:49
Feng Qin8-Apr-02 1:49 
Questionhow can get the CPU info! Pin
wangyiming8-Apr-02 1:02
wangyiming8-Apr-02 1:02 
AnswerRe: how can get the CPU info! Pin
Lizp8-Apr-02 2:13
Lizp8-Apr-02 2:13 
GeneralRe: how can get the CPU info! Pin
wangyiming8-Apr-02 19:01
wangyiming8-Apr-02 19:01 
GeneralUndeclared Identifier Pin
7-Apr-02 22:55
suss7-Apr-02 22:55 

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.