delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/08/11/21:55:39

From: dbe AT wgn DOT net ("$Bill Luebkert")
Subject: Re: socket binding
11 Aug 1997 21:55:39 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <33EFDF9C.52A1.cygnus.gnu-win32@wgn.net>
References: <Pine DOT SOL DOT 3 DOT 96 DOT 970811151933 DOT 8443B-100000 AT jade1>
Reply-To: dbe AT wgn DOT net
Mime-Version: 1.0
X-Mailer: Mozilla 3.02Gold (Win95; U)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Dong Zhou wrote:
> 
> Hi all,
> 
> A question about sockets.
> 
> It seems that my program can't correctly bind a socket.
> The code is like following:
> 
>         if ((fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0)) < 0)
>             err("socket");
>         if (bind(fd, &sinme, sizeof(sinme)) < 0)
>             err("bind");
> 
> The socket() call is successful but the bind() fails, and the error
> number it returned is 106, which, from "errno.h", is EAFNOSUPPORT.

That means address family not supported.
So what did you set the address family in sinme to?

> and, TCP/IP stuff seems are working well (at least I can use Netscape and
> ftp...) and the program actually works on Solaris. (The port number
> assigned is 5001)
> 
> Can somebody tell me: what does the error mean? and what is the problem
> behind it? (something wrong with my NT system?)

Where's the rest of the pertinent code, like setting up sinme?

-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Email: dbe AT wgn DOT net
-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Email: dbe AT wgn DOT net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019