Subject: Re: socket()
From: [email-masked]

17 Feb 1998 17:02:22 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
To: [email-masked]

>   Dr. David K. Johnson ([email-masked])
>   Tue, 17 Feb 1998 08:15:03 -0500
>       
>I have tried to recompile and run a simple socket server from Unix to my
>PC with
>b18-
>
>however, my socket creation is not working...
>
>the code is essentially following Curry's "Unix Systems Programming"
>Example
>
>if ((s=socket(AF_INET, SOCK_STREAM, 0))< 0)
>{
>    perror("socket");
>    exit(1);
>}
>
>and here is where my code exits every time with a negative descriptor
>for the socket??
>I am assuming that to compile,  all I need is gcc -o svr svr.c
>and that the cygwin.dll will act as libnsl and libsocket for me...
>
>has anyone else encountered this? Am I missing something very simple?
>
Depends what you use for your .h files.  The <cygwin/...> include directory
contains .h files which convert socket() calls into cygwin_socket() calls
that usually work.  Also, using cygwin.dll means never having to initialize
wsock32.dll explicitly the way all those unfortunate MING32 programmers have
to.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".