Article View: borland.public.cppbuilder.internet.socket
Article #5398Re: Using network protocols without a network
From: p Anders
Date: Wed, 01 Sep 2004 19:45
Date: Wed, 01 Sep 2004 19:45
45 lines
2642 bytes
2642 bytes
But the code works fine on the network - keep in mind that I am completely
disconnected from the network - I have disabled my network connection, thus
when I try to connect I get a 10065 WSA error.
For what it's worth, here's the code snippet that is failing:
struct sockaddr_in ServerAddress;
ServerAddress.sin_family = AF_INET;
ServerAddress.sin_addr.s_addr = m_dwAddress; // m_dwAddress == 4294967295
ServerAddress.sin_port = m_wPort; // == m_wPort =
htons(channelPortNumber); where channelPortNumber=8000
if (connect(m_oSocket,(struct
sockaddr*)&ServerAddress,sizeof(ServerAddress)) == SOCKET_ERROR)
{
char Msg[256];
sprintf(Msg, "SocketC::Connect --> Socket failed to connect to
address: %lu, port: %u",m_dwAddress,ntohs(m_wPort));
AMF_AF_ExceptionC amfe(AMF_AF_ExceptionC::ET_FATAL_ERROR, Msg);
DWORD exceptionCode = WSAGetLastError();
amfe.SetCode(exceptionCode);
throw amfe;
}
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:41362510$1@newsgroups.borland.com...
>
> "p Anders" <paul.anderson@jhuapl.edu> wrote in message
> news:413621c6$1@newsgroups.borland.com...
>
> > This does not seem to work, however. I am trying to create
> > a UDP socket while not connected to the network and I am
> > receiving an " WSAENETUNREACH " error. The socket I
> > am creating is for UDP broadcast. I am using Windows 2000.
>
> Please show your actual code. Sockets work just fine on a single machine
as
> well as over a network, so you must be using the socket wrong in your
code.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<413626df$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<413621c6$1@newsgroups.borland.com> <41362510$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,67c1fa77c2983b92 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "p Anders" <paul.anderson@jhuapl.edu> From: "p Anders" <paul.anderson@jhuapl.edu> Newsgroups: borland.public.cppbuilder.internet.socket References: <413621c6$1@newsgroups.borland.com> <41362510$1@newsgroups.borland.com> Subject: Re: Using network protocols without a network Date: Wed, 1 Sep 2004 15:45:37 -0400 Lines: 47 Organization: JHU/APL X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 128.244.21.67 Message-ID: <413626df$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1094067935 128.244.21.67 (1 Sep 2004 12:45:35 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail