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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3190aba277f0ce3e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-05 18:06:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!arclight.uoregon.edu!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail From: Caffeine Junky Subject: Re: Question on Client - Server communication Newsgroups: comp.lang.ada References: User-Agent: Pan/0.11.3 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Preben Randhol" Message-ID: NNTP-Posting-Host: 12.245.48.122 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc52.ops.asp.att.net 1025917605 12.245.48.122 (Sat, 06 Jul 2002 01:06:45 GMT) NNTP-Posting-Date: Sat, 06 Jul 2002 01:06:45 GMT Organization: AT&T Broadband Date: Sat, 06 Jul 2002 01:06:45 GMT Xref: archiver1.google.com comp.lang.ada:26893 Date: 2002-07-06T01:06:45+00:00 List-Id: On Fri, 05 Jul 2002 04:08:18 -0400, Preben Randhol wrote: > 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). Use port "forwarding". Very simple. The server designates a standard port. The application connects to the server on that port. The server then tells the application to switch to port number X and opens a connection on that port. This leaves the original port open to recieve more app requests. There are alot of servers that do this. Check out thier source code. Apache comes to mind. St4pL3