Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #34538
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Knute Johnson <nospam@rabbitbrush.frazmtn.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Picking an unused port number |
| Date | Tue, 7 Jun 2016 09:40:52 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 64 |
| Message-ID | <nj6tek$so7$1@dont-email.me> (permalink) |
| References | <gIGdna5umL551yLRRVn_vwA@giganews.com> <e72b1da8-383c-4a75-9d47-6f4cd0993b2a@googlegroups.com> <niv172$pns$1@dont-email.me> <bba8bc85-7414-4d32-aba8-07d8f54a4c93@googlegroups.com> <nj4u4n$siu$1@dont-email.me> <drnfpkFp1n5U1@mid.individual.net> <nj6miv$1oi$1@dont-email.me> <drob1bFueveU1@mid.individual.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Tue, 7 Jun 2016 16:40:52 -0000 (UTC) |
| Injection-Info | mx02.eternal-september.org; posting-host="fc10d1b501433caa198830294d826923"; logging-data="29447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ULemUdWbgT7cCqK2kQGkK" |
| User-Agent | Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
| In-Reply-To | <drob1bFueveU1@mid.individual.net> |
| Cancel-Lock | sha1:vklTHVhiI4yGDDEmPhOA36e3vWo= |
| Xref | csiph.com comp.lang.java.programmer:34538 |
Show key headers only | View raw
On 6/7/2016 09:28, Nigel Wade wrote: > On 07/06/16 15:43, Knute Johnson wrote: >> On 6/7/2016 01:43, Nigel Wade wrote: >>> On 06/06/16 23:40, Knute Johnson wrote: >>>> Any port works until there is a conflict. It's what you do about it >>>> then that separates the easy from the hard. >>>> >>> >>> The best way to avoid conflicts is to allow the system to give you an >>> unallocated port and then register that port using some method such as >>> rpcbind, or in the Java world, rmiregistry. These two methods are >>> primarily for registering remote procedures/methods, but can also be >>> used for simply registering an assigned port to provide a named service. >>> >>> A client can query portmap or rmiregistry to find out what port a >>> particular service is registered, and listening, on. >>> The only port numbers which then need to be well defined are those used >>> by portmap or rmiregistry. rpcbind/portmap is required by NFS and NIS >>> (formerly YP). I use rmiregistry with some of my applications where I >>> need to operate a server but don't wish to define a fixed port number >>> (to avoid possible future conflicts). >>> >> >> Nigel >> >> Do you know where I can get more detailed information on how to do >> that? I've never played with rmiregistry. >> > > http://docs.oracle.com/javase/tutorial/rmi/index.html > is a good place to start. > > This FAQ is something I used to use. The Java version does indicate how > long ago it was that I last programmed RMI, > http://docs.oracle.com/javase/1.5.0/docs/guide/rmi/faq.html#netcontact > The code I have was mostly written in Java 1.4, so it's a bit out of date. > > In essence, RMI allows you to invoke remote methods on a server without > having to worry about Sockets and ports and the low level nastiness > normally associated with client/server communication. You declare your > methods, parameters and return result as normal. The low level socket > creation, object serialisation/deserialisation and method invocation is > all taken care of for you. > > An RMI server extends some implementation of Remote, and registers it > with rmiregistry using Naming or Registry bind/rebind methods. A client > wishing to invoke remote methods on the server uses the Naming or > Registry lookup method to locate the server, and receives a copy of the > Remote object. The methods in the Remote object can be invoked just as > if they were methods in a local class in the same JVM. I can't offhand > remember why there is the duplication of Naming, Registry and > LocateRegistry. > > It's not entirely as simple as that, but it's essentially all there is > to it. Apart from classpaths, and locating the classes. That can be a > bit more interesting, especially for the rmiregistry. > > Thanks Nigel! -- Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Picking an unused port number nathanturner369@gmail.com - 2016-06-04 08:24 -0700
Re: Picking an unused port number Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-06-04 09:56 -0700
Re: Picking an unused port number Eric Douglas <e.d.programmer@gmail.com> - 2016-06-06 05:28 -0700
Re: Picking an unused port number Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-06-06 15:40 -0700
Re: Picking an unused port number Nigel Wade <nmw@ion.le.ac.uk> - 2016-06-07 09:43 +0100
Re: Picking an unused port number Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-06-07 07:43 -0700
Re: Picking an unused port number Nigel Wade <nmw@ion.le.ac.uk> - 2016-06-07 17:28 +0100
Re: Picking an unused port number Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-06-07 09:40 -0700
Re: Picking an unused port number Nigel Wade <nmw@ion.le.ac.uk> - 2016-06-08 10:32 +0100
Re: Picking an unused port number Eric Douglas <e.d.programmer@gmail.com> - 2016-06-08 06:45 -0700
Re: Picking an unused port number Nigel Wade <nmw@ion.le.ac.uk> - 2016-06-08 15:06 +0100
Re: Picking an unused port number Eric Douglas <e.d.programmer@gmail.com> - 2016-06-08 07:36 -0700
Re: Picking an unused port number Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-08 18:03 +0000
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-04 20:50 -0400
Re: Picking an unused port number Wayne <wayne@nospam.invalid> - 2016-06-06 18:44 -0400
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-06 20:52 -0400
Re: Picking an unused port number Arne Vajhøj <arne@vajhoej.dk> - 2016-06-06 21:28 -0400
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-06 21:45 -0400
Re: Picking an unused port number Arne Vajhøj <arne@vajhoej.dk> - 2016-06-06 23:07 -0400
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-07 09:50 -0400
Re: Picking an unused port number Lew <lewbloch@gmail.com> - 2016-06-07 13:46 -0700
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-07 19:31 -0400
Re: Picking an unused port number Lew <lewbloch@gmail.com> - 2016-06-07 17:26 -0700
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-07 21:34 -0400
Re: Picking an unused port number Lew <lewbloch@gmail.com> - 2016-06-08 13:52 -0700
Re: Picking an unused port number Jerry Stuckle <jstucklex@attglobal.net> - 2016-06-08 17:49 -0400
Re: Picking an unused port number Arne Vajhøj <arne@vajhoej.dk> - 2016-06-07 21:53 -0400
Re: Picking an unused port number a.laforgia@gmail.com - 2016-06-07 00:11 -0700
csiph-web