From: "Benno J. Mengis"
Subject: [fpc-pascal]sockets under win32
Hi everybody
are the socksvr/sockcli examples from fcl only for linux or also for
win32.
i can not make them, got the impression, ssockets is only for linux.
Linux only. To do windows socket programing it's best to use the winsock unit (e.g. from the contribs' page or the Delphi - JEDI header conversions).
is there other example code avaiable on how to use sockets (or winsock) on
a win32 system? any help would be appreciated.
I recommend to try "Beej's Guide to Socket programming" from http://www.ecst.csuchico.edu/~beej/guide/net/ which is a imo good introduction to basic sockets programming (e.g. sending and receiving data, how to do a basic server).
The example code inside is written in C there should be no problem porting it, it's pretty straightforward and the examples are quite small too (nearly the same as the ones in the RTL docs). Additionally he focuses on the Linux platform - but he does _not_ use any Linux specific capabilities at all (e.g. using socket handles as file handles as it is done in the RTL docs). A small section about the changes for the Win32 platform is included (some additional startup code).
If you do have problems to convert those programs feel free to ask.
Regards,
Thomas