delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/14/10:23:08

From: tangent AT cyberport DOT com (Warren Young)
Subject: Re: Plain win32 programming with sockets how?
14 Jan 1999 10:23:08 -0800 :
Message-ID: <4.1.19990114030430.00a7dc90.cygnus.gnu-win32@mail.cyberport.com>
References: <002601be3edf$5db896c0$05ff79c3 AT joco DOT wxs DOT nl>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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
"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