public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gthomas@redhat.com>
To: "Trenton D. Adams" <tadams@extremeeng.com>
Cc: eCos mailing list <ecos-discuss@sources.redhat.com>
Subject: RE: [ECOS] RE: Determining network ERROR codes
Date: Thu, 19 Jul 2001 15:17:00 -0000	[thread overview]
Message-ID: <XFMail.20010719161728.gthomas@redhat.com> (raw)
In-Reply-To: <000d01c1109a$1e195830$090110ac@TRENT>

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.

  reply	other threads:[~2001-07-19 15:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-19 14:30 Trenton D. Adams
2001-07-19 15:17 ` Gary Thomas [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=XFMail.20010719161728.gthomas@redhat.com \
    --to=gthomas@redhat.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=tadams@extremeeng.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).