Subject: Re: Plain win32 programming with sockets how?
From: [email-masked] (Warren Young)

14 Jan 1999 10:23:08 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: [email-masked]

At 11:27 AM 1/13/99 +0100, you wrote:
>How can i get the below code working without the need of the Cygwin?

[snip]

>     nbytes = write (sock, message, strlen (message));  

Use the send() call here: same syntax, but with a fourth argument, which is
usually 0.

>         perror ("write");

No perror under Win32.  Roll your own.  Example 10 in my FAQ (see link in
my signature) has a function that works roughly like perror, except that it
prints into a buffer instead of stdout, and only works with Winsock errors,
not general Win32 errors.

>     close (sock);  

closesocket().

Given those changes, your code should compile under any sane Win32 compiler.

Good luck,

= Warren Young -- Maintainer of the Winsock Programmer's FAQ at:
= http://www.cyberport.com/~tangent/programming/winsock/
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".