Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #20855 > unrolled thread

single instance

Started byRoedy Green <see_website@mindprod.com.invalid>
First post2013-01-01 12:23 -0800
Last post2013-01-16 15:09 -0800
Articles 20 on this page of 100 — 15 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-01 12:23 -0800
    Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-01 16:40 -0500
      Re: single instance Robert Tomsick <robert+usenet@tomsick.net> - 2013-01-03 01:20 -0500
    Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-03 00:55 -0800
      Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-03 19:31 -0800
        Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-03 19:49 -0800
        Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-03 19:56 -0800
          Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-04 12:18 -0500
            Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-04 10:22 -0800
              Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-04 13:44 -0500
                Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-04 11:03 -0800
                  Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-04 14:12 -0500
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-05 21:56 -0500
                  Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 19:22 -0500
                    Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:23 -0500
                      Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 20:43 -0500
                        Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:47 -0500
                          Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 20:51 -0500
                    Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:24 -0500
                      Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 20:46 -0500
                        Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:58 -0500
                          Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 21:08 -0500
                            Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 21:19 -0500
                              Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 21:31 -0500
                                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 21:41 -0500
                                  Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 22:00 -0500
                                    Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 22:11 -0500
                                      Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-07 00:23 -0500
                                        Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 18:20 -0500
                                Re: single instance Joshua Cranmer <Pidgeot18@verizon.invalid> - 2013-01-06 21:39 -0600
                                  Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-07 00:30 -0500
                        Re: single instance lipska the kat <lipskathekat@yahoo.co.uk> - 2013-01-07 08:53 +0000
                          Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 18:18 -0500
                            Re: single instance lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-02-25 08:31 +0000
                        Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 18:17 -0500
                    Re: single instance Lew <lewbloch@gmail.com> - 2013-01-06 17:32 -0800
                      Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 20:47 -0500
                        Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:53 -0500
                          Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 21:01 -0500
            Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-05 21:59 -0500
              Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 19:34 -0500
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:00 -0500
    Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-03 07:12 -0800
      Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-03 09:56 -0800
        Re: single instance Martin Gregorie <martin@address-in-sig.invalid> - 2013-01-03 21:05 +0000
          Re: single instance Martin Gregorie <martin@address-in-sig.invalid> - 2013-01-03 22:08 +0000
          Re: single instance "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-01-05 12:48 +0000
            Re: single instance Martin Gregorie <martin@address-in-sig.invalid> - 2013-01-05 17:43 +0000
              Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-05 09:49 -0800
              Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-05 13:02 -0500
                Re: single instance Martin Gregorie <martin@address-in-sig.invalid> - 2013-01-05 20:29 +0000
                  Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-05 19:07 -0800
                  Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-06 20:04 -0500
              Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-05 21:40 -0500
      Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-05 22:10 -0500
        Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-05 19:49 -0800
          Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-05 23:09 -0500
            Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 11:00 -0500
              Re: single instance Lew <lewbloch@gmail.com> - 2013-01-06 09:41 -0800
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:41 -0500
          Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-15 22:51 -0800
            Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-15 23:12 -0800
              Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-15 23:49 -0800
            Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-15 23:16 -0800
              Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-15 23:52 -0800
              Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-16 08:46 -0800
                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-16 10:46 -0800
                  Re: single instance markspace <markspace@nospam.nospam> - 2013-01-16 13:01 -0800
                  Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-16 17:10 -0800
            Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-15 23:50 -0800
              Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-16 00:13 -0800
                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-16 02:48 -0800
                  Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-16 07:28 -0800
                    Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-16 10:46 -0800
                      Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-16 16:53 -0800
                        Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-16 23:44 -0800
                          Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-17 07:03 -0800
                            Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 14:25 -0800
                              Re: single instance Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2013-01-17 16:31 -0800
                                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 22:11 -0800
                                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 22:36 -0800
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-16 13:34 -0500
            Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-16 08:45 -0800
            Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-16 13:29 -0500
              Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-16 17:14 -0800
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-16 20:20 -0500
                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-16 23:52 -0800
                Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 01:44 -0800
          Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-18 01:47 -0800
            Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-18 20:50 -0800
              Re: single instance Roedy Green <see_website@mindprod.com.invalid> - 2013-01-20 00:53 -0800
                Re: single instance Lew <lewbloch@gmail.com> - 2013-01-20 12:00 -0800
                  Re: single instance Knute Johnson <nospam@knutejohnson.com> - 2013-01-20 13:33 -0800
                    Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-02-24 18:12 -0500
                Re: single instance Arne Vajhøj <arne@vajhoej.dk> - 2013-01-20 21:33 -0500
        Re: single instance "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-01-06 13:34 +0000
    Re: single instance Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-04 10:26 -0800
      Re: single instance Twirlip of the Mists <twirlip@killfile.me.now.invalid> - 2013-01-04 14:04 -0500
    Re: single instance stledger@lanl.gov - 2013-01-16 14:51 -0800
      Re: single instance stledger@lanl.gov - 2013-01-16 15:09 -0800

Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →


#21423

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-15 22:51 -0800
Message-ID<vajcf81hgbr7sj6o79dlu8uphiknm6qs4f@4ax.com>
In reply to#21010
On Sat, 05 Jan 2013 19:49:08 -0800, Knute Johnson
<nospam@knutejohnson.com> wrote, quoted or indirectly quoted someone
who said :

>
>The risk is, that in Windows anyway, where the system clock granularity 
>is 17ms it is possible to start two copies of a program with a batch 

I have been studying Knute's code and Peter's commentary hoping to
come up with a canned package for ensuring single Instance.

Using system.nanotime aught to help avoid granularity trouble.

I am puzzled about   "227.228.229.230" the IP used. Where did that
value come from?  Can this be made to work with IPV6?
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21424

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-15 23:12 -0800
Message-ID<pikcf8pnkfchvbnc8p9accls5eddpfcrdj@4ax.com>
In reply to#21423
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>
>I am puzzled about   "227.228.229.230" the IP used. Where did that
>value come from?  Can this be made to work with IPV6?

I discovered that 224.x.x.x - 239.x.x.x are reserved for IP multicast.
I could pick a random number in the range, or is it ok that everyone
uses the same IP or is it REQUIRED that everyone use the same IP

-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21426

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-15 23:49 -0800
Message-ID<sytfjgl8wjt5$.14bwiza7lsfhw$.dlg@40tude.net>
In reply to#21424
On Tue, 15 Jan 2013 23:12:12 -0800, Roedy Green wrote:

> On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
> <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
> someone who said :
> 
>>
>>I am puzzled about   "227.228.229.230" the IP used. Where did that
>>value come from?  Can this be made to work with IPV6?
> 
> I discovered that 224.x.x.x - 239.x.x.x are reserved for IP multicast.
> I could pick a random number in the range, or is it ok that everyone
> uses the same IP or is it REQUIRED that everyone use the same IP

If they want to receive multicast messages for a given group, they have to
listen for them on that group's address (i.e. "required").

[toc] | [prev] | [next] | [standalone]


#21425

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-15 23:16 -0800
Message-ID<upkcf89mpoq2vapcshn44sdpo2hkjcvjlb@4ax.com>
In reply to#21423
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>
>I have been studying Knute's code and Peter's commentary hoping to
>come up with a canned package for ensuring single Instance.

If you had two machines on a LAN, would they prevent the other from
running a new instance?  You don't want, that, just on the same
machine.

If you wanted that behaviour -- e.g. to enforce a single instance
licence across the LAN, what do you do have make the all one group?
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21428

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-15 23:52 -0800
Message-ID<1b36h02mtn70a.1or1v8j4itc7u.dlg@40tude.net>
In reply to#21425
On Tue, 15 Jan 2013 23:16:56 -0800, Roedy Green wrote:

> On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
> <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
> someone who said :
> 
>>
>>I have been studying Knute's code and Peter's commentary hoping to
>>come up with a canned package for ensuring single Instance.
> 
> If you had two machines on a LAN, would they prevent the other from
> running a new instance?  You don't want, that, just on the same
> machine.
> 
> If you wanted that behaviour -- e.g. to enforce a single instance
> licence across the LAN, what do you do have make the all one group?

One option is to compute the multicast group address from the machine's own
local address.  For example, on many LANs UDP broadcasts (including
multicast) are not routed past the 255.255.255.0 subnet, and so you could
just use the last octet of the IP address for the last octet of the
multicast group address.  Depending on the LAN topology, that or some
variation on the idea could work.

But more reliable would be to just transmit the machine's IP address as
part of the app-singleton protocol you design, so that each recipient of
the multicast address can distinguish between instances on the local
machine and those elsewhere.

Pete

[toc] | [prev] | [next] | [standalone]


#21439

FromKnute Johnson <nospam@knutejohnson.com>
Date2013-01-16 08:46 -0800
Message-ID<kd6lhj$go$2@dont-email.me>
In reply to#21425
On 1/15/2013 11:16 PM, Roedy Green wrote:
> On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
> <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
> someone who said :
>
>>
>> I have been studying Knute's code and Peter's commentary hoping to
>> come up with a canned package for ensuring single Instance.
>
> If you had two machines on a LAN, would they prevent the other from
> running a new instance?  You don't want, that, just on the same
> machine.
>
> If you wanted that behaviour -- e.g. to enforce a single instance
> licence across the LAN, what do you do have make the all one group?
>

Same IP and port.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#21443

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-16 10:46 -0800
Message-ID<7ctdf85ci3ets58u7qf72vqt30orabna85@4ax.com>
In reply to#21439
On Wed, 16 Jan 2013 08:46:42 -0800, Knute Johnson
<nospam@knutejohnson.com> wrote, quoted or indirectly quoted someone
who said :

>
>Same IP and port.

 But how far does this ripple?  
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21447

Frommarkspace <markspace@nospam.nospam>
Date2013-01-16 13:01 -0800
Message-ID<kd74fg$bt3$1@dont-email.me>
In reply to#21443
On 1/16/2013 10:46 AM, Roedy Green wrote:
> On Wed, 16 Jan 2013 08:46:42 -0800, Knute Johnson
> <nospam@knutejohnson.com> wrote, quoted or indirectly quoted someone
> who said :
>
>>
>> Same IP and port.
>
>   But how far does this ripple?
>


As far as I know, it only works on your network segment.  Only for 
machines connected to the same physical router or gateway.

The multicast stuff is really more of a router protocol.  A machine 
broadcasts to one or more addresses, and the routers along the way take 
care of passing the stream to interested client machines.

Also note that as far as I know, absolutely no routers implement this. 
It's a dead protocol.

[toc] | [prev] | [next] | [standalone]


#21458

FromKnute Johnson <nospam@knutejohnson.com>
Date2013-01-16 17:10 -0800
Message-ID<kd7j2q$2di$1@dont-email.me>
In reply to#21443
On 1/16/2013 10:46 AM, Roedy Green wrote:
> On Wed, 16 Jan 2013 08:46:42 -0800, Knute Johnson
> <nospam@knutejohnson.com> wrote, quoted or indirectly quoted someone
> who said :
>
>>
>> Same IP and port.
>
>   But how far does this ripple?
>

Routers are the usual place that the Multicast packet is stopped.  But 
you could certainly use it in your local network.

-- 

Knute Johnson

[toc] | [prev] | [next] | [standalone]


#21427

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-15 23:50 -0800
Message-ID<hamcf85ejcefc9veso4dr08rb88tet8b9u@4ax.com>
In reply to#21423
On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>
>I am puzzled about   "227.228.229.230" the IP used. Where did that
>value come from?  Can this be made to work with IPV6?

This is beginning to come clear. This the name of the group.  Everyone
sends and receives on the same socket on the same group.

Just as you have a problem assigning an unused socket, you have
assigning an unassigned group. 

I don't see how this works between machines yet.

I think it should work like this:

You ask the OS , please assign me a free port. Here is a UUID. If
anyone asks for a port presenting the same UUID, please give him the
same one, no matter if he is calling from within the machine or
without.  With such a scheme, you would not need reserved ports
(except for the port assigning port), and you could not have
collisions.  Internally arrays of sockets could be dense.  You can
then hard code in UUIDs into apps. Users don't need to worry about
collisions. Perhaps in IPV8.


-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21429

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-16 00:13 -0800
Message-ID<pfudiv6pp55j.19556bqp3b6dg.dlg@40tude.net>
In reply to#21427
On Tue, 15 Jan 2013 23:50:05 -0800, Roedy Green wrote:

> On Tue, 15 Jan 2013 22:51:45 -0800, Roedy Green
> <see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
> someone who said :
> 
>>
>>I am puzzled about   "227.228.229.230" the IP used. Where did that
>>value come from?  Can this be made to work with IPV6?
> 
> This is beginning to come clear. This the name of the group.  Everyone
> sends and receives on the same socket on the same group.
> 
> Just as you have a problem assigning an unused socket, you have
> assigning an unassigned group. 
> 
> I don't see how this works between machines yet.

See my other replies.

> I think it should work like this:
> 
> You ask the OS , please assign me a free port. Here is a UUID. If
> anyone asks for a port presenting the same UUID, please give him the
> same one, no matter if he is calling from within the machine or
> without.  With such a scheme, you would not need reserved ports
> (except for the port assigning port), and you could not have
> collisions.  Internally arrays of sockets could be dense.  You can
> then hard code in UUIDs into apps. Users don't need to worry about
> collisions. Perhaps in IPV8.

Since the problem is solveable using the existing mechanisms, I don't see a
compelling reason the above feature should be included in future versions
of IP.

Also, I'm no expert, but I'm not sure that any of the IP specifications
concern themselves with ports at all.  That might be at the TCP and UDP
protocol levels, independent of the IP stuff.  So neither IPv6 nor IPv8
_could_ address this issue.

If we ever do get a new TCP and/or UDP in which there's a change to how
ports work, I would expect the solution to be simpler than what you
propose. I.e. just as IPv6 gave us essentially globally-unique IP
addresses, any update to TCP or UDP should give us globally unique port
numbers.

You wouldn't need the OS to associate a UUID with a port; the UUID would
_be_ the port.

Pete

[toc] | [prev] | [next] | [standalone]


#21433

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-16 02:48 -0800
Message-ID<eeucf89l4dikvceinp68r8rni72esdjovl@4ax.com>
In reply to#21429
On Wed, 16 Jan 2013 00:13:06 -0800, Peter Duniho
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
someone who said :

>You wouldn't need the OS to associate a UUID with a port; the UUID would
>_be_ the port.

the UUID would be the port. The 16-bit port would just be an shorthand
abbreviation for it.  You could even have a hybrid system.  The
assigner just avoids well known ports or ports that have been
explicitly assigned.

don't port numbers appear in UDP packets and TCP/IP packets, though
the assignment of them may not be part of the protocol?

RFC 322 says that UCLA will maintain the list of reserved port
numbers.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21434

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-16 07:28 -0800
Message-ID<1i1ry0rsgaxnm$.blszeyxb737b$.dlg@40tude.net>
In reply to#21433
On Wed, 16 Jan 2013 02:48:23 -0800, Roedy Green wrote:

> On Wed, 16 Jan 2013 00:13:06 -0800, Peter Duniho
> <NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
> someone who said :
> 
>>You wouldn't need the OS to associate a UUID with a port; the UUID would
>>_be_ the port.
> 
> the UUID would be the port. The 16-bit port would just be an shorthand
> abbreviation for it.

We call that, in the programming community, a "hash code".  It's not
unique, and therefore not useful as an actual port ID.

> You could even have a hybrid system.  The
> assigner just avoids well known ports or ports that have been
> explicitly assigned.
> 
> don't port numbers appear in UDP packets and TCP/IP packets, though
> the assignment of them may not be part of the protocol?

As I said, I'm not an expert.  But TCP and UDP are transported over IP, and
as far as I know, IP datagrams do not store the port #.  Those are part of
the TCP and UDP formats layered above IP.

Thus changes to IP would not address port numbers.

> RFC 322 says that UCLA will maintain the list of reserved port
> numbers.

Uh, so?

Even if there's a TCPv2 and UDPv2 that support UUID for port
identification, there will still be a need for reserved port numbers and
someone will have to maintain the list of those numbers.

Pete

[toc] | [prev] | [next] | [standalone]


#21442

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-16 10:46 -0800
Message-ID<m3tdf8deu2g60jffpd4jarqgi44kakshlm@4ax.com>
In reply to#21434
On Wed, 16 Jan 2013 07:28:38 -0800, Peter Duniho
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
someone who said :

>> the UUID would be the port. The 16-bit port would just be an shorthand
>> abbreviation for it.
>
>We call that, in the programming community, a "hash code".  It's not
>unique, and therefore not useful as an actual port ID.


A hash is different.  The assignment process might work with a HashMap
or like a HashMap. If hashes collide you assign different 16 bit
numbers. It is a dynamic process.  You don't always get the same 16
bit port from the same UUID.

If you are sure the port is reserved for you, you just use the 16 bit
version. If not, you ask for a port reservation (good for perhaps one
second) given the UUID.  Then you use the 16 bit port. When you close
it, the reservation disappears.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21454

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-16 16:53 -0800
Message-ID<9g02074ucl0a.1pdynjyqd1bgs$.dlg@40tude.net>
In reply to#21442
On Wed, 16 Jan 2013 10:46:21 -0800, Roedy Green wrote:

> On Wed, 16 Jan 2013 07:28:38 -0800, Peter Duniho
> <NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
> someone who said :
> 
>>> the UUID would be the port. The 16-bit port would just be an shorthand
>>> abbreviation for it.
>>
>>We call that, in the programming community, a "hash code".  It's not
>>unique, and therefore not useful as an actual port ID.
> 
> 
> A hash is different. 

No, it's not.  If you have a UUID larger than 16 bits, then any "16-bit
shorthand" is necessarily non-unique for all possible UUIDs, and is thus a
hash code.

> The assignment process might work with a HashMap
> or like a HashMap. If hashes collide you assign different 16 bit
> numbers. It is a dynamic process.  You don't always get the same 16
> bit port from the same UUID.
> 
> If you are sure the port is reserved for you, you just use the 16 bit
> version. If not, you ask for a port reservation (good for perhaps one
> second) given the UUID.  Then you use the 16 bit port. When you close
> it, the reservation disappears.

If you are simply asking the OS to enforce uniqueness for your 16-bit port
number, then why bother?  You need to update the software to handle the
full UUID anyway; you might as well just always use that for the port
number.

Pete

[toc] | [prev] | [next] | [standalone]


#21469

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-16 23:44 -0800
Message-ID<1qaff8p3p38ts67fjk5en8bu94cee1hgi7@4ax.com>
In reply to#21454
On Wed, 16 Jan 2013 16:53:46 -0800, Peter Duniho
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
someone who said :

>No, it's not.  If you have a UUID larger than 16 bits, then any "16-bit
>shorthand" is necessarily non-unique for all possible UUIDs, and is thus a
>hash code.

The 16 bit code is assigned only for a short time, then they can be
recycled for use by a different UUID.   Unless a UUID is in use on a
particular machine it does not have a 16 bit assignment.

16 bits are plenty for IN USE UUIDs on one machine.

I am not suggesting UUIDs get assigned universally to a 16 bit id,
e.g. being assigned a permanent well known port number. That would
fail in minutes.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21476

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-17 07:03 -0800
Message-ID<1xeeh2v8glf1m$.143zfbqwfmh7g$.dlg@40tude.net>
In reply to#21469
On Wed, 16 Jan 2013 23:44:57 -0800, Roedy Green wrote:

> On Wed, 16 Jan 2013 16:53:46 -0800, Peter Duniho
> <NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
> someone who said :
> 
>>No, it's not.  If you have a UUID larger than 16 bits, then any "16-bit
>>shorthand" is necessarily non-unique for all possible UUIDs, and is thus a
>>hash code.
> 
> The 16 bit code is assigned only for a short time, then they can be
> recycled for use by a different UUID.   Unless a UUID is in use on a
> particular machine it does not have a 16 bit assignment.
> 
> 16 bits are plenty for IN USE UUIDs on one machine.
> 
> I am not suggesting UUIDs get assigned universally to a 16 bit id,
> e.g. being assigned a permanent well known port number. That would
> fail in minutes.

Whatever you mean, it doesn't make sense for a program that has to know the
UUID to bother with a 16-bit port value also.  If a UUID is involved, then
just use it.  Mapping the UUID to a 16-bit value doesn't fix anything when
to get the 16-bit port value, you have to know the UUID.

Just use the UUID.

[toc] | [prev] | [next] | [standalone]


#21491

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-17 14:25 -0800
Message-ID<tdugf8pdnclcbgk2uf2jpfpr4r2k4bhl2h@4ax.com>
In reply to#21476
On Thu, 17 Jan 2013 07:03:54 -0800, Peter Duniho
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
someone who said :

>
>Whatever you mean, it doesn't make sense for a program that has to know the
>UUID to bother with a 16-bit port value also.  If a UUID is involved, then
>just use it.  Mapping the UUID to a 16-bit value doesn't fix anything when
>to get the 16-bit port value, you have to know the UUID.
>
>Just use the UUID.

There is no need to put a pair of  UUID socket numbers in every
packet. That is a waste of bits. You do want a 16 bit shorthand. Maybe
eventually a 64 bit port number, but for now such as conversion would
be considered too disruptive. What I am calling for now would just be
an optional add-on mechanism to assign a free port.

-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


#21503

FromPeter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
Date2013-01-17 16:31 -0800
Message-ID<1y5zyjmcxgwp$.eqtqlj3dt5hr.dlg@40tude.net>
In reply to#21491
On Thu, 17 Jan 2013 14:25:57 -0800, Roedy Green wrote:

> On Thu, 17 Jan 2013 07:03:54 -0800, Peter Duniho
> <NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
> someone who said :
> 
>>
>>Whatever you mean, it doesn't make sense for a program that has to know the
>>UUID to bother with a 16-bit port value also.  If a UUID is involved, then
>>just use it.  Mapping the UUID to a 16-bit value doesn't fix anything when
>>to get the 16-bit port value, you have to know the UUID.
>>
>>Just use the UUID.
> 
> There is no need to put a pair of  UUID socket numbers in every
> packet.

Oh, yes...there's absolutely is. The mapping you describe could only be
valid locally, as part of the application API. On the network, the numbers
have to be unique. Otherwise there's no way for the OS to know who actually
sent or should receive the message.

It's bad enough even when the port #'s are known to be unique. It's why we
have TIME_WAIT. A transient mapping would be even worse.

> That is a waste of bits.

Have you looked at how much data a typical TCP connection involves these
days? 48, or even 112 more bits is nothing.

> You do want a 16 bit shorthand. Maybe
> eventually a 64 bit port number, but for now such as conversion would
> be considered too disruptive. What I am calling for now would just be
> an optional add-on mechanism to assign a free port.

It would not be possible in the way you seem to envision it.

Pete

[toc] | [prev] | [next] | [standalone]


#21510

FromRoedy Green <see_website@mindprod.com.invalid>
Date2013-01-17 22:11 -0800
Message-ID<7sphf81sraa1uqmtsv56pu2t63qju9loif@4ax.com>
In reply to#21503
On Thu, 17 Jan 2013 16:31:14 -0800, Peter Duniho
<NpOeStPeAdM@NnOwSlPiAnMk.com> wrote, quoted or indirectly quoted
someone who said :

>
>It would not be possible in the way you seem to envision it.

We are going around in circles.  Would a someone else like to weigh
in?
-- 
Roedy Green Canadian Mind Products http://mindprod.com
The first 90% of the code accounts for the first 90% of the development time.
The remaining 10% of the code accounts for the other 90% of the development 
time. 
~ Tom Cargill  Ninety-ninety Law 

[toc] | [prev] | [next] | [standalone]


Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web