Click here to Skip to main content
16,004,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDate/Time Picker 'Enter' key behavior Pin
JYoder10-Jun-04 4:11
JYoder10-Jun-04 4:11 
GeneralRe: Date/Time Picker 'Enter' key behavior Pin
bikram singh10-Jun-04 15:45
bikram singh10-Jun-04 15:45 
GeneralMoving dialog window Pin
marcomars10-Jun-04 3:44
marcomars10-Jun-04 3:44 
GeneralRe: Moving dialog window Pin
David Crow10-Jun-04 5:32
David Crow10-Jun-04 5:32 
GeneralRe: Moving dialog window Pin
Diddy10-Jun-04 5:35
Diddy10-Jun-04 5:35 
GeneralActive X Control Error Pin
Anonymous10-Jun-04 3:32
Anonymous10-Jun-04 3:32 
GeneralSetGraphicsMode bug? Please try this code Pin
CodeHead10-Jun-04 3:03
CodeHead10-Jun-04 3:03 
GeneralHELP! Winsock problem about the select function... Pin
JoeZhang10-Jun-04 2:49
JoeZhang10-Jun-04 2:49 
hi, guys,

In my current Winsock-based TCP program, on the client side, after I send my request data packet to the Server side using the send socket function, I attempt to get the socket status to see if it has something to read using the select function, and the select function always return 0 meaning the time limit expired on some users' computers, but it's just fine on another users' computers.

Why? Does anybody can tell me why and how to fix it? Thanks!

here's the code...

//...
SOCKET sckClient = socket(AF_INET, SOCK_STREAM, 0);

int nOne = 1;
setsockopt(sckClient, IPPROTO_TCP, TCP_NODELAY, (char *)&nOne, sizeof(int)); // just_say_no

struct sockaddr_in addr_to = { 0 };
//...
connect(sckClient, (struct sockaddr *)&addr_to, sizeof(addr_to));

char *buf;
//...
send(sckClient, (const char *)((char*)buf), nDataToSend, 0);

int nRetCode = ::select((int)sckClient + 1, &fdsRead, NULL, NULL, &tvTimeOut);
if (nRetCode==0 )
{ //ERROR: the time limit expired
//Here's the problem! some computers meet the error, but some don't! WHY???
}

recv(sckClient,(char *)buf,nDataToRead, 0);

//...
GeneralRe: HELP! Winsock problem about the select function... Pin
valikac10-Jun-04 6:16
valikac10-Jun-04 6:16 
GeneralA message of sorry Pin
gamitech10-Jun-04 2:09
gamitech10-Jun-04 2:09 
GeneralUse of ASCII seperators for Windows 98 systems Pin
J.B.10-Jun-04 1:49
J.B.10-Jun-04 1:49 
GeneralRe: Use of ASCII seperators for Windows 98 systems Pin
Johan Rosengren10-Jun-04 2:41
Johan Rosengren10-Jun-04 2:41 
GeneralRe: Use of ASCII seperators for Windows 98 systems Pin
J.B.10-Jun-04 4:59
J.B.10-Jun-04 4:59 
GeneralRe: Use of ASCII seperators for Windows 98 systems Pin
Johan Rosengren10-Jun-04 6:03
Johan Rosengren10-Jun-04 6:03 
GeneralRe: Use of ASCII seperators for Windows 98 systems Pin
J.B.10-Jun-04 16:48
J.B.10-Jun-04 16:48 
GeneralRe: Use of ASCII seperators for Windows 98 systems Pin
Johan Rosengren10-Jun-04 19:28
Johan Rosengren10-Jun-04 19:28 
QuestionHow to use lstrcpy? Pin
Rajesh_K_Sharma10-Jun-04 1:34
Rajesh_K_Sharma10-Jun-04 1:34 
AnswerRe: How to use lstrcpy? Pin
Diddy10-Jun-04 1:37
Diddy10-Jun-04 1:37 
AnswerRe: How to use lstrcpy? Pin
jmkhael10-Jun-04 1:55
jmkhael10-Jun-04 1:55 
GeneralResize button on IE toolbar Pin
Hans Ruck10-Jun-04 1:08
Hans Ruck10-Jun-04 1:08 
GeneralMessage of Thanks Pin
Krugger40410-Jun-04 0:29
Krugger40410-Jun-04 0:29 
GeneralRe: Message of Thanks Pin
Roger Allen10-Jun-04 2:09
Roger Allen10-Jun-04 2:09 
GeneralRe: Message of Thanks Pin
David Crow10-Jun-04 2:47
David Crow10-Jun-04 2:47 
GeneralRe: Message of Thanks Pin
jmkhael10-Jun-04 3:09
jmkhael10-Jun-04 3:09 
GeneralRe: Message of Thanks Pin
David Crow10-Jun-04 3:40
David Crow10-Jun-04 3: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.