TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: All
from: Brett Maxfield
date: 1996-07-05 09:55:04
subject: sockets with emx/gcc & warp

I was wondering if anybody is familiar with building tcp/ip servers
with warp, specifically using the emx/bsd programming interface.

As i understand it:

    1. use socket() to open a endpoint for the connection

    2. get the local hostname using gethostname()
    3. get the ip address for the local host using gethostbyname()
    4. bind() this address to the socket got by socket()
    
    5. use listen() to enable incoming connects
    6. accept() an incoming connection, or wait for one
    7. spawn or fork a process to handle that connection

    8. go back to 6, or close if there was an exit request.

My question is, how to you set the recieving tcp/ip port address
to something once you have got the number out of /etc/services.

Any actual bsd-sockets code or emx-specific code would be very 
helpful. Basically i want to write daemon that will get tcp/ip
port and spawn processes to perform io on each incoming
connection (the same as telnetd would).. 

Cheers
Brett
 

--- Maximus/2 3.01
* Origin: Space Now! BBS (3:640/374)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 517 628 713/888 800/1
@PATH: 640/374 201 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.