TCP Socket Client Example

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 14 07:09:59 PDT 2015


On Friday, 14 August 2015 at 14:06:03 UTC, Kingsley wrote:
> Does anyone have some examples of making a client socket 
> connection to a host on a port and parsing the incoming data in 
> some kind of loop.

I put one in chapter 2 of my book:
https://www.packtpub.com/application-development/d-cookbook

Here's the code sample alone:
http://arsdnet.net/dcode/book/chapter_02/03/

The client just takes lines from the user and forwards them to 
the server. Not really useful alone but maybe it will show you 
how to get started. The text in the book itself goes into a 
little more detail and you can look up the functions here 
http://dlang.org/phobos/std_socket.html for a lil more info.


More information about the Digitalmars-d mailing list