comp.lang.ada
 help / color / mirror / Atom feed
* Question on Client - Server communication
@ 2002-07-05  8:08 Preben Randhol
  2002-07-05  9:23 ` John R. Strohm
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Preben Randhol @ 2002-07-05  8:08 UTC (permalink / raw)


I'm doing a small program to learn a bit about socket programming with
clients and servers. Besides I need the program.

What I want is an application that can talk to the same application
running on a different machine. This is ok and no problem. However I
cannot know the port the application is listening to (there may be
several users runnig the same application on the same machine).
Therefore in order to contact the other application I need a server
running on each machine with a known port number. Then I can do this (_A
= on machine A, _B on machine B): App_A contacts Server_B which tells
App_B to contact App_A on port XXXX. So Server_B will only deliver this
message to App_B and not the whole stream between the two. Does this
seem like a OK way to do this? Or is there a better way using socket
programming (not GLADE). 

Now there is two ways of doing this as I see it. 

   Should App_B and Server_B keep an open connection at all time so that
   Server_B can tell App_B to contact App_A? 

   If Server_B or App_B is closed at some point then App_B can try to
   connect again as it can see that the socket when down.

   Or

   Should App_B contact Server_B on startup and say hi I am user ZZZZ
   you can contact me on port YYYY and then close the connection so that
   Server_B only contact port YYYY when needed?

   The latter can be a bit problematic if App_B is closed and opened
   again. Another problem is if the Server_B is closed and opened again
   as it then looses all the port numbers and username.

App_A and App_B must be run at all time so that the user can either
recieve or send requests. 

Thanks for any hints in advance.

(I'm using GNAT 3.14p with AdaSockets)
-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 �For me, Ada95 puts back the joy in programming.�



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

end of thread, other threads:[~2002-07-16  6:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-05  8:08 Question on Client - Server communication Preben Randhol
2002-07-05  9:23 ` John R. Strohm
2002-07-05  9:48 ` Fabien Garcia
2002-07-05 10:05   ` Lutz Donnerhacke
2002-07-05 12:47     ` Fabien Garcia
2002-07-05 14:20       ` Lutz Donnerhacke
2002-07-05 10:09 ` John McCabe
2002-07-05 14:58 ` Thierry Lelegard
2002-07-06 23:19   ` Robert A Duff
2002-07-07  1:14     ` David C. Hoos, Sr.
2002-07-06  1:06 ` Caffeine Junky
2002-07-06 19:55   ` Preben Randhol
2002-07-07  2:37     ` Caffeine Junky
2002-07-16  6:32       ` Craig Carey

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