Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get the name of the files in the zip file! Pin
BadJerry18-Aug-05 3:26
BadJerry18-Aug-05 3:26 
QuestionHow? Pin
Ali Tavakol18-Aug-05 3:09
Ali Tavakol18-Aug-05 3:09 
AnswerRe: How? Pin
BadJerry18-Aug-05 3:25
BadJerry18-Aug-05 3:25 
GeneralRe: How? Pin
Ali Tavakol18-Aug-05 5:09
Ali Tavakol18-Aug-05 5:09 
GeneralRe: How? Pin
BadJerry18-Aug-05 5:11
BadJerry18-Aug-05 5:11 
GeneralConverting and existing Doc/View application to Dialog Based Application Pin
Anonymous18-Aug-05 2:46
Anonymous18-Aug-05 2:46 
GeneralRe: Converting and existing Doc/View application to Dialog Based Application Pin
Gary R. Wheeler18-Aug-05 3:57
Gary R. Wheeler18-Aug-05 3:57 
GeneralWinsock Help Pin
Eytukan18-Aug-05 2:45
Eytukan18-Aug-05 2:45 
Please have a look at the below code patiently..

hi i've done the simple version of client server application.. i've handled the abrupt disconnection of client (not using Try/catch).. its fine.. but please tell me how to reconnect to the client which wants to connect again.. what i've done is

GetDataThread()
{
while(1)
{
if (client disconnects)
{
break;
}
}
RestartSock(); // comes here after "break"
}


RestartSock()
{
EndThread(GetDataThread); that Continuously looks for accepting data from client.
initSock(); ---->ok
bindSock(); ------>ok
listenSock();---->ok
acceptSock();----------->NOT OK ... the ctrl's not going abov this Frown | :( .(see Acceptsock)
AfxMessageBox("Client Connected");
AfxBeginThread(GetDataThread,this);
}


void acceptSock()
{

SOCKET AcceptSocket;

while (1) //waits for client to connect
{
AcceptSocket = SOCKET_ERROR;

//NOT COMMING OUT OF The BELOW LOOP WHEN THE CLIENT CONNECTS THE SECOND TIME...

while ( AcceptSocket == SOCKET_ERROR ) ------->
{
AcceptSocket = accept( m_socket, NULL, NULL );

}
m_socket = AcceptSocket;
AfxMessageBox("Client Connected");
break;
}


}


for the first time everything is fine... but when the client tries to connect second time.. the client says that Its Connected but its not done.. the Server goes into the ACCEPT Loop.. please help me out...

Regards,
V
GeneralHow to reuse a socket? Pin
Eytukan18-Aug-05 4:15
Eytukan18-Aug-05 4:15 
GeneralU GUYS MADE ME GO TO MSDN AGAIN :( Pin
Eytukan18-Aug-05 6:39
Eytukan18-Aug-05 6:39 
GeneralBitmap from HDC Pin
rocky_pulley18-Aug-05 1:06
rocky_pulley18-Aug-05 1:06 
GeneralRe: Bitmap from HDC Pin
Tejan Zad18-Aug-05 1:28
Tejan Zad18-Aug-05 1:28 
Generalexecute application Pin
Marc Soleda18-Aug-05 0:42
Marc Soleda18-Aug-05 0:42 
GeneralRe: execute application Pin
Trollslayer18-Aug-05 1:20
mentorTrollslayer18-Aug-05 1:20 
GeneralRe: execute application Pin
Marc Soleda18-Aug-05 1:51
Marc Soleda18-Aug-05 1:51 
GeneralRe: execute application Pin
Marc Soleda18-Aug-05 4:10
Marc Soleda18-Aug-05 4:10 
GeneralRe: execute application Pin
TheGreatAndPowerfulOz18-Aug-05 14:23
TheGreatAndPowerfulOz18-Aug-05 14:23 
GeneralRe: execute application Pin
Marc Soleda18-Aug-05 20:18
Marc Soleda18-Aug-05 20:18 
GeneralRe: execute application Pin
Christopher Stratmann13-Jul-06 5:32
Christopher Stratmann13-Jul-06 5:32 
GeneralRe: execute application Pin
Marc Soleda14-Jul-06 1:07
Marc Soleda14-Jul-06 1:07 
GeneralProgramming of all types of visual c++ Pin
meiyueh18-Aug-05 0:40
meiyueh18-Aug-05 0:40 
GeneralRe: Programming of all types of visual c++ Pin
toxcct18-Aug-05 1:21
toxcct18-Aug-05 1:21 
GeneralRe: Programming of all types of visual c++ Pin
Trollslayer18-Aug-05 1:25
mentorTrollslayer18-Aug-05 1:25 
GeneralRe: Programming of all types of visual c++ Pin
David Crow18-Aug-05 2:53
David Crow18-Aug-05 2:53 
QuestionRemembering Detail view setting in File open dialog? Pin
Tejan Zad18-Aug-05 0:06
Tejan Zad18-Aug-05 0:06 

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.