AF_INET connection refused help pls

Corinna Vinschen
Thu Dec 6 04:10:00 GMT 2001

On Thu, Dec 06, 2001 at 06:16:02AM -0500, Haksun Li wrote:
> I am having problem writing a little program using cygwin. It is about a
> client sending message to a server.

User error.

> Server:
> [...]
>   server_addr.sin_family = hp->h_addrtype;
>   bcopy((char*)hp->h_addr, (char*)&server_addr.sin_addr, hp->h_length);
>   server_addr.sin_port = port;

That should read:

    server_addr.sin_port = htons(port);

It works coincidentally on Solaris because host and network byteorder
are the same on Solaris.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                      
Red Hat, Inc.

Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list