delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/02/17/06:08:19

From: johnson_david AT keithley DOT com (Dr. David K. Johnson)
Subject: socket()
17 Feb 1998 06:08:19 -0800 :
Message-ID: <34E98D57.3496E52D.cygnus.gnu-win32@keithley.com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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

<sys/types>
<sys/socket>
<netinet/in.h>
:
:

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?

Thanks

davej



-
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