comp.lang.ada
 help / color / mirror / Atom feed
* Need help creating a multi client TCP server with Ada
@ 2014-02-06 21:42 alex.aanis
  2014-02-06 22:23 ` adambeneschan
  2014-02-07 18:34 ` Simon Wright
  0 siblings, 2 replies; 7+ messages in thread
From: alex.aanis @ 2014-02-06 21:42 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-07 18:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 21:42 Need help creating a multi client TCP server with Ada alex.aanis
2014-02-06 22:23 ` 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

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