comp.lang.ada
 help / color / mirror / Atom feed
From: alex.aanis@gmail.com
Subject: Need help creating a multi client TCP server with Ada
Date: Thu, 6 Feb 2014 13:42:46 -0800 (PST)
Date: 2014-02-06T13:42:46-08:00	[thread overview]
Message-ID: <1408dd3b-f555-4b75-94ef-cdb9c06ed0ca@googlegroups.com> (raw)

Hi, 
Im new here and an Ada beginner. I have created a server/client TCP program which works nicely but the problem is I don't know how to accept more than one client. Code is on github: goo.gl/RvNIei

The server has 3 tasks. listener, writer, reader task.

--Listener task
--Listen for incoming connections
--Notify on client connect
--Save the new channel for future read and write access

Sockets.Accept_Socket(...)
channel := Sockets.Stream (Connection);
Put_Line ( Sockets.Image (Client) & " connected.");


I tried to create a doubly linked list which points to channel( GNAT.Sockets.Stream_Access ) using Ada.containers with out any luck! It seems that Ada.containers.double_linked_list cant be used with stream_access types.

1. How may I proceed with this? 
2. How can I know if one client has been disconnected?


Alex



             reply	other threads:[~2014-02-06 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 21:42 alex.aanis [this message]
2014-02-06 22:23 ` Need help creating a multi client TCP server with Ada adambeneschan
2014-02-06 23:40   ` alex.aanis
2014-02-07  8:48     ` Jacob Sparre Andersen
2014-02-07 17:16       ` alex.aanis
2014-02-07 17:53         ` Dmitry A. Kazakov
2014-02-07 18:34 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox