Detecting modem hangup with socjet

P

Pattt

All,

I'm currently programming a socket client library.
I want to access a server via ppp

I can detect when the server close the socket

I wan to detect when the modem is switch to off and I can NOT.

Here is my code

lRet = select(uiSocket + 1, &fdsRead, NULL, NULL, &timeout);
switch (lRet)
{
case SOCKET_ERROR:
// Pbm with cnx
break;

case 0:
// Timeout reached, nothing to read
break;

default:
if (FD_ISSET(uiSocket, &fdsRead))
{
lLen = recv(uiSocket, ptrChar2Get, 1, 0);
if (lLen <= 0)
{
// Pbm with cnx
}

// everything is fine
}
}

Any idea?

Patrick.
 
U

Unforgiven

Pattt said:
All,

I'm currently programming a socket client library.
I want to access a server via ppp

This is off-topic for this newsgroup. Please ask in a newsgroup where your
platform and/or sockets library are topical.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top