From: Preben Randhol <randhol+ada@pvv.org>
Subject: Question on Client - Server communication
Date: Fri, 5 Jul 2002 10:08:18 +0200
Date: 2002-07-05T10:08:18+02:00 [thread overview]
Message-ID: <mailman.1025856482.6739.comp.lang.ada@ada.eu.org> (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.�
next reply other threads:[~2002-07-05 8:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-05 8:08 Preben Randhol [this message]
2002-07-05 9:23 ` Question on Client - Server communication 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox