Click here to Skip to main content
15,903,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMFC Dialog app and ShellExecute() Pin
Steve Messer16-Feb-04 20:20
Steve Messer16-Feb-04 20:20 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Prakash Nadar16-Feb-04 20:41
Prakash Nadar16-Feb-04 20:41 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Steve Messer16-Feb-04 20:51
Steve Messer16-Feb-04 20:51 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Prakash Nadar16-Feb-04 22:10
Prakash Nadar16-Feb-04 22:10 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Steve Messer16-Feb-04 22:24
Steve Messer16-Feb-04 22:24 
GeneralRe: MFC Dialog app and ShellExecute() Pin
David Crow17-Feb-04 3:05
David Crow17-Feb-04 3:05 
GeneralRe: MFC Dialog app and ShellExecute() Pin
Steve Messer17-Feb-04 6:00
Steve Messer17-Feb-04 6:00 
GeneralI have written a program which will accept only 20 connections to the server port. If connection goes beyond 20 then below mentioned code will be executed which is in while loop Pin
kathyayini16-Feb-04 19:39
kathyayini16-Feb-04 19:39 
I have written a program which will accept only 20 connections to the server port. If connection goes beyond 20 then below mentioned code will be executed which is in while loop

memset(cSendBuf,' ',23);
memset(&sd, '\0', 23);

printf("\nRejecting Excess Client %s ...\n",inet_ntoa(sockAddr.sin_addr));
strcpy(sd.cstrmsg,"Rejecting Excess Client");
strcpy(cSendBuf,"");
printf("sd.cstrmsg is ;%s\n",sd.cstrmsg);
memcpy(cSendBuf,sd.cstrmsg,23);
int x=send(sock_id,cSendBuf,23,MSG_NOSIGNAL);
printf("x is %d\n",x);
close(sock_id);
continue;

Problem is socket closes before data is sent to client, so client fails to receive data (even though close is after send). Is there is any way to wait till client receives data and then close the socket or other solution like that. If i put sleep(2); before close then it works fine. Using sleep is not a right way to wait.

Waiting for the reply.Smile | :)
GeneralRe: I have written a program which will accept only 20 connections to the server port. If connection goes beyond 20 then below mentioned code will be executed which is in while loop Pin
pfsat16-Feb-04 20:45
pfsat16-Feb-04 20:45 
GeneralRe: I have written a program which will accept only 20 connections to the server port. If connection goes beyond 20 then below mentioned code will be executed which is in while loop Pin
kathyayini16-Feb-04 22:54
kathyayini16-Feb-04 22:54 
GeneralRe: I have written a program which will accept only 20 connections to the server port. If connection goes beyond 20 then below mentioned code will be executed which is in while loop Pin
pfsat26-Feb-04 10:12
pfsat26-Feb-04 10:12 
GeneralProperty sheet inside a Form View Pin
P_JAYAPRAKASH16-Feb-04 18:51
P_JAYAPRAKASH16-Feb-04 18:51 
GeneralRe: Property sheet inside a Form View Pin
Prakash Nadar16-Feb-04 19:14
Prakash Nadar16-Feb-04 19:14 
GeneralRe: Property sheet inside a Form View Pin
Rick York16-Feb-04 19:50
mveRick York16-Feb-04 19:50 
GeneralRe: Property sheet inside a Form View Pin
Selvam R17-Feb-04 0:06
professionalSelvam R17-Feb-04 0:06 
GeneralTooltips in a dialog based application Pin
satadru16-Feb-04 18:45
satadru16-Feb-04 18:45 
GeneralRe: Tooltips in a dialog based application Pin
Selvam R16-Feb-04 21:10
professionalSelvam R16-Feb-04 21:10 
GeneralHELP, Run time error - Pure virtual function call Pin
Md Saleem Navalur16-Feb-04 18:35
Md Saleem Navalur16-Feb-04 18:35 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
John M. Drescher16-Feb-04 19:18
John M. Drescher16-Feb-04 19:18 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
Prakash Nadar16-Feb-04 19:32
Prakash Nadar16-Feb-04 19:32 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
Steve S17-Feb-04 2:23
Steve S17-Feb-04 2:23 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
Prakash Nadar17-Feb-04 3:27
Prakash Nadar17-Feb-04 3:27 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
Roger Allen17-Feb-04 6:37
Roger Allen17-Feb-04 6:37 
GeneralRe: HELP, Run time error - Pure virtual function call Pin
Prakash Nadar17-Feb-04 14:53
Prakash Nadar17-Feb-04 14:53 
GeneralWorking with Images and Dialogs Pin
dkmorris199916-Feb-04 18:32
dkmorris199916-Feb-04 18:32 

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.