comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <jacob@jacob-sparre.dk>
Subject: Re: Need help creating a multi client TCP server with Ada
Date: Fri, 07 Feb 2014 09:48:27 +0100
Date: 2014-02-07T09:48:27+01:00	[thread overview]
Message-ID: <87vbwrmhpg.fsf@adaheads.sparre-andersen.dk> (raw)
In-Reply-To: e5831305-5db7-4f0c-b19f-51acc229251a@googlegroups.com

alex.aanis@gmail.com writes:

> Yes, I now can can store the channels. However I still can't connect
> more than one client. Is there something wrong with my listener task:
>
>  task body listenerTask is
>   status      : Sockets.Selector_Status;
>   Client      : Sockets.Sock_Addr_Type;
>   Connection  : Sockets.Socket_Type;
>   channel      : Sockets.Stream_Access;
>   
>  begin
>   loop
>    Sockets.Accept_Socket (
> 			  Server  => Receiver,
> 			  Socket  => Connection,
> 			  Address => Client,
> 			  timeout => 30.0,
> 			  Status  => status
> 			 );
>
>    channel := Sockets.Stream (Connection);
>    channels.Append (channel);
>
>   end loop;
>  end;

It looks like it might work.  Have you set up your receiver correctly?
Where are the connections processed?  It appears that "Channels" is a
global variable.  Have you made sure to make it protected?

You may want to add an exception handler to your listener task for
reporting any exceptions in the task.

It would be nice if you could adhere to the style described in the Ada
Quality and Style Guide (indentation, labels after "end", identifiers).

Greetings,

Jacob
-- 
"Computer Science is to Science, as Plumbing is to Hydrodynamics"

  reply	other threads:[~2014-02-07  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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