Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 6 Dec 2001 12:43:38 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: AF_INET connection refused help pls Message-ID: <20011206124338.D740@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from haksunli@engin.umich.edu on Thu, Dec 06, 2001 at 06:16:02AM -0500 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 -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/