From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,3190aba277f0ce3e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-05 01:08:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newspeer.clara.net!news.clara.net!oleane.net!oleane!freenix!enst!enst.fr!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Question on Client - Server communication Date: Fri, 5 Jul 2002 10:08:18 +0200 Organization: PVV Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: avanie.enst.fr 1025856482 50419 137.194.161.2 (5 Jul 2002 08:08:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 5 Jul 2002 08:08:02 +0000 (UTC) Return-Path: Content-Disposition: inline User-Agent: Mutt/1.3.28i Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:26865 Date: 2002-07-05T10:08:18+02:00 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.�