X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <49367BA2.E94E724E@dessent.net> Date: Wed, 03 Dec 2008 04:29:22 -0800 From: Brian Dessent MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Socket programming with Cygwin References: <003201c9552c$a57b1a00$4001a8c0 AT mycomputer> <493665A0 DOT 6F1DE647 AT dessent DOT net> <008701c9553b$c4751a50$4001a8c0 AT mycomputer> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com John Emmas wrote: > Forgive me - but as someone who's very new to socket programming, I'm > confused about why the program worked when I built it under Linux. Is it > because something would have converted "localhost" to an IP address (is this > the lookup stuff that you referred to?) and where can I find out a bit more > about all this? Using the older/classic Berkeley API, the socket app calls gethostbyname() to convert a hostname to an address. The newer modern API is getaddrinfo() which has a slightly different interface and is more friendly for name lookups that could return IPv6 results. If you google "sockets programming tutorial" or the like I'm sure you can find some detailed guides. Keep in mind when reading these things that the native Windows socket API is Winsock, which is similar to the Berkeley socket API but has significant differences. One of the advantages of Cygwin is that you do *not* use the Winsock API, you use Berkeley/POSIX socket API, so don't try to use any Winsock tutorials or example code. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/