* [ECOS] RE: Determining network ERROR codes
@ 2001-07-19 14:30 Trenton D. Adams
2001-07-19 15:17 ` Gary Thomas
0 siblings, 1 reply; 5+ messages in thread
From: Trenton D. Adams @ 2001-07-19 14:30 UTC (permalink / raw)
To: 'Trenton D. Adams', 'eCos mailing list'
>
> Ok, how do I know what error corresponds to what? I got an error of
331
> on a connect () call. Aren't these supposed to be standard errors?
> They don't seem to return the same errors as they do on Windows.
Maybe
> windows redefines them!
>
> Anyhow, where do I look for this information?
>
I have the following code. Connect keeps returning 331 EADDRNOTAVAIL.
I have no idea why that might happen. This program would work with a
few modifications on linux and windows as far as I recall. Inet_addr ()
does return an IP address in network byte order so I can't see that
being a problem. Any ideas?
int s;
int one = 1;
struct sockaddr_in addr;
diag_printf("Start socket test\n");
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
diag_printf("socket() = %d\n", s);
addr.sin_addr.s_addr = inet_addr ("172.16.1.9");
addr.sin_family = AF_INET;
addr.sin_port = htons (1024);
addr.sin_len = sizeof (addr);
if (connect (s, &addr, sizeof (addr)) != 0)
{
diag_printf ("Error connecting to socket! - %d\n",
errno);
cyg_test_exit();
}
send (s, "Hello From eCos", strlen ("Hello From eCos"), 0);
cyg_test_exit();
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [ECOS] RE: Determining network ERROR codes
2001-07-19 14:30 [ECOS] RE: Determining network ERROR codes Trenton D. Adams
@ 2001-07-19 15:17 ` Gary Thomas
2001-07-19 15:20 ` Trenton D. Adams
0 siblings, 1 reply; 5+ messages in thread
From: Gary Thomas @ 2001-07-19 15:17 UTC (permalink / raw)
To: Trenton D. Adams; +Cc: eCos mailing list
On 19-Jul-2001 Trenton D. Adams wrote:
> >
> > Ok, how do I know what error corresponds to what? I got an error of
> 331
> > on a connect () call. Aren't these supposed to be standard errors?
> > They don't seem to return the same errors as they do on Windows.
> Maybe
> > windows redefines them!
> >
> > Anyhow, where do I look for this information?
> >
>
> I have the following code. Connect keeps returning 331 EADDRNOTAVAIL.
> I have no idea why that might happen. This program would work with a
> few modifications on linux and windows as far as I recall. Inet_addr ()
> does return an IP address in network byte order so I can't see that
> being a problem. Any ideas?
>
> int s;
> int one = 1;
> struct sockaddr_in addr;
>
> diag_printf("Start socket test\n");
>
> s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
> diag_printf("socket() = %d\n", s);
>
> addr.sin_addr.s_addr = inet_addr ("172.16.1.9");
> addr.sin_family = AF_INET;
> addr.sin_port = htons (1024);
> addr.sin_len = sizeof (addr);
> if (connect (s, &addr, sizeof (addr)) != 0)
> {
> diag_printf ("Error connecting to socket! - %d\n",
> errno);
> cyg_test_exit();
> }
>
> send (s, "Hello From eCos", strlen ("Hello From eCos"), 0);
>
> cyg_test_exit();
Have you run the eCos standard networking tests?
I'd try leaving off the IPPROTO_TCP on the socket() call - use 0.
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [ECOS] RE: Determining network ERROR codes
2001-07-19 15:17 ` Gary Thomas
@ 2001-07-19 15:20 ` Trenton D. Adams
0 siblings, 0 replies; 5+ messages in thread
From: Trenton D. Adams @ 2001-07-19 15:20 UTC (permalink / raw)
To: 'Gary Thomas'; +Cc: 'eCos mailing list'
You must not have gotten my message about solving the problem. I solved
it before your last reply! It was sent to the list. It seems the list
is going slow today.
Anyhow, I called "init_all_network_interfaces();"
> -----Original Message-----
> From: gary@chez-thomas.org [ mailto:gary@chez-thomas.org ] On Behalf
Of
> Gary Thomas
> Sent: Thursday, July 19, 2001 4:17 PM
> To: Trenton D. Adams
> Cc: eCos mailing list
> Subject: RE: [ECOS] RE: Determining network ERROR codes
>
>
> On 19-Jul-2001 Trenton D. Adams wrote:
> > >
> > > Ok, how do I know what error corresponds to what? I got an
error
> of
> > 331
> > > on a connect () call. Aren't these supposed to be standard
> errors?
> > > They don't seem to return the same errors as they do on
Windows.
> > Maybe
> > > windows redefines them!
> > >
> > > Anyhow, where do I look for this information?
> > >
> >
> > I have the following code. Connect keeps returning 331
EADDRNOTAVAIL.
> > I have no idea why that might happen. This program would work
with a
> > few modifications on linux and windows as far as I recall.
Inet_addr
> ()
> > does return an IP address in network byte order so I can't see
that
> > being a problem. Any ideas?
> >
> > int s;
> > int one = 1;
> > struct sockaddr_in addr;
> >
> > diag_printf("Start socket test\n");
> >
> > s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
> > diag_printf("socket() = %d\n", s);
> >
> > addr.sin_addr.s_addr = inet_addr ("172.16.1.9");
> > addr.sin_family = AF_INET;
> > addr.sin_port = htons (1024);
> > addr.sin_len = sizeof (addr);
> > if (connect (s, &addr, sizeof (addr)) != 0)
> > {
> > diag_printf ("Error connecting to socket! - %d\n",
> > errno);
> > cyg_test_exit();
> > }
> >
> > send (s, "Hello From eCos", strlen ("Hello From eCos"), 0);
> >
> > cyg_test_exit();
>
> Have you run the eCos standard networking tests?
>
> I'd try leaving off the IPPROTO_TCP on the socket() call - use 0.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ECOS] RE: Determining network ERROR codes
@ 2001-07-19 14:46 Trenton D. Adams
0 siblings, 0 replies; 5+ messages in thread
From: Trenton D. Adams @ 2001-07-19 14:46 UTC (permalink / raw)
To: 'eCos mailing list'
init_all_network_interfaces();
I love it when I answer my own questions.
Sorry for the DUMBass message!!
> -----Original Message-----
> From: Trenton D. Adams [ mailto:tadams@extremeeng.com ]
> Sent: Thursday, July 19, 2001 3:31 PM
> To: 'Trenton D. Adams'; 'eCos mailing list'
> Subject: RE: Determining network ERROR codes
>
> >
> > Ok, how do I know what error corresponds to what? I got an
error of
> 331
> > on a connect () call. Aren't these supposed to be standard
errors?
> > They don't seem to return the same errors as they do on Windows.
> Maybe
> > windows redefines them!
> >
> > Anyhow, where do I look for this information?
> >
>
> I have the following code. Connect keeps returning 331
EADDRNOTAVAIL.
> I have no idea why that might happen. This program would work with
a
> few modifications on linux and windows as far as I recall.
Inet_addr ()
> does return an IP address in network byte order so I can't see that
> being a problem. Any ideas?
>
> int s;
> int one = 1;
> struct sockaddr_in addr;
>
> diag_printf("Start socket test\n");
>
> s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
> diag_printf("socket() = %d\n", s);
>
> addr.sin_addr.s_addr = inet_addr ("172.16.1.9");
> addr.sin_family = AF_INET;
> addr.sin_port = htons (1024);
> addr.sin_len = sizeof (addr);
> if (connect (s, &addr, sizeof (addr)) != 0)
> {
> diag_printf ("Error connecting to socket! - %d\n",
> errno);
> cyg_test_exit();
> }
>
> send (s, "Hello From eCos", strlen ("Hello From eCos"), 0);
>
> cyg_test_exit();
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ECOS] RE: Determining network ERROR codes
@ 2001-07-19 14:14 Trenton D. Adams
0 siblings, 0 replies; 5+ messages in thread
From: Trenton D. Adams @ 2001-07-19 14:14 UTC (permalink / raw)
To: 'Trenton D. Adams', 'eCos mailing list'
>
> Ok, how do I know what error corresponds to what? I got an error of
331
> on a connect () call. Aren't these supposed to be standard errors?
> They don't seem to return the same errors as they do on Windows.
Maybe
> windows redefines them!
>
> Anyhow, where do I look for this information?
>
Ok, I found it in error\current\codes.h which is not where I expected to
find it since it's a network error. Anyhow, I get EADDRNOTAVAIL. This
should not happen. I'll see if I can figure it out before I ask any
more questions though.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-07-19 15:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-19 14:30 [ECOS] RE: Determining network ERROR codes Trenton D. Adams
2001-07-19 15:17 ` Gary Thomas
2001-07-19 15:20 ` Trenton D. Adams
-- strict thread matches above, loose matches on Subject: below --
2001-07-19 14:46 Trenton D. Adams
2001-07-19 14:14 Trenton D. Adams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).