delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/17/18:30:10

Newsgroups: comp.os.msdos.djgpp
From: rd5718 AT irix DOT bris DOT ac DOT uk (Rich Dawe)
Subject: Re: hmmmm
X-Nntp-Posting-Host: irix.bris.ac.uk
Message-ID: <F44s4K.IJ2@fsa.bris.ac.uk>
Lines: 51
Sender: usenet AT fsa DOT bris DOT ac DOT uk (Usenet)
Organization: University of Bristol, England
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
References: <3675D61D DOT 1DAE8B15 AT islandia DOT is> <01be297d$acd76280$4b9cdbcd AT briantea>
Date: Thu, 17 Dec 1998 22:36:19 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

B. Teague (nospam AT all DOT com) wrote:
: In theory, you would create the socket with "create", then bind it with
: "bind", then connect with it with
: "connect."  I've never done it with DJGPP, but that's the sequence with my

	The functions you use depend upon whether you want you program to
connect to another computer or listen.

	To connect to another computer you use the following sequence:

1. Create a socket using socket().
2. Connect to the host you want using connect().

There are other steps like converting a host name like "myhost.foo.com" to
an IP address like 192.168.0.91.

	To listen for connections you use the following sequence:

1. Create a socket using socket().
2. Decide which addresses to listen on, and which port, using bind().
3. Specify the number of connections to queue, using listen().
4. Accept incoming connections using accept().

: The other thing is, you might be using Windows (3.x, 9x) and DJGPP doesn't
: do sockets with winsock (or, at least, not very nicely.)

	You can get many add on libraries for DJGPP. I maintain one called
libsocket, see http://libsocket.home.ml.org/. This works with Windows 3.x
and some version of Windows '95 (Winsock 1.x, not Winsock 2). It provides
BSD networking functions - the ones described above. It comes with man
pages and an HTML guide to the functions, plus some demo programs.

	However, if you prefer C++, Dan Hedlund has a library called
WSOCK. George Foot also has a networking library called libnet that works
on more OSes than libsocket (I think). I can't remember the URLs for
either of these, but a Dejanews search (http://www.dejanews.com/) of this
newsgroup should find these for you.

: Kjartan Baldursson <steinknu AT islandia DOT is> wrote in article
: <3675D61D DOT 1DAE8B15 AT islandia DOT is>...
: > How can i Connect to someone with
: > Connect(AF_INET,...........
: > as Internet protocol such ip / port

	Hope this helps.

-- 
==============================================================================
         Rich Dawe - 4th-year MSci Physicist @ Bristol University, UK
           richdawe AT bigfoot DOT com, http://www.bigfoot.com/~richdawe/
==============================================================================

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019