Article View: borland.public.cppbuilder.internet.socket
Article #5216Dectecting modem hangup
From: Pattt
Date: Sat, 02 Oct 2004 17:04
Date: Sat, 02 Oct 2004 17:04
38 lines
1532 bytes
1532 bytes
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.
Technical Details
Message-ID:
<415edfa0$0$21358$8fcfb975@news.wanadoo.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,e8f37972125dabf4,start X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!not-for-mail From: "Pattt" <pribault@wanadoo.fr> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Dectecting modem hangup Date: Sat, 2 Oct 2004 19:04:34 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Lines: 40 Message-ID: <415edfa0$0$21358$8fcfb975@news.wanadoo.fr> Organization: les newsgroups par Wanadoo NNTP-Posting-Host: ANice-101-1-1-66.w193-251.abo.wanadoo.fr X-Trace: 1096736672 news.wanadoo.fr 21358 193.251.85.66:1090 X-Complaints-To: abuse@wanadoo.fr