D Lang Socket Programming Example
vyarthrot via Digitalmars-d
digitalmars-d at puremagic.com
Fri Sep 25 00:42:24 PDT 2015
On Friday, 6 September 2013 at 20:47:54 UTC, Savsak wrote:
> Hi Friends,
>
> Socket programming with the D programming language is the most
> simple way how to do it
>
> For example, the sample with Tango, but not by phobos
>
> How do I do this with a simple, but phobos
>
>
> import tango.io.Stdout;
>
> import tango.net.Socket;
> import tango.net.ServerSocket;
> import tango.net.SocketConduit;
>
> int main() {
> Socket server = new Socket(AddressFamily.UNIX,
> SocketType.STREAM,
> ProtocolType.IP);
>
> while(true) {
> Socket client = server.accept();
>
> char[1024] buffer;
> client.receive(buffer);
>
> Stdout.format("The client said'{}'.", buffer);
>
> client.shutdown(SocketShutdown.BOTH);
> client.detach();
> }
> return 0;
> }
Try this simple socket programming....
http://csharp.net-informations.com/communications/csharp-socket-programming.htm
More information about the Digitalmars-d
mailing list