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


Groups > comp.lang.javascript > #30668 > unrolled thread

HTTP/2 stole my Applet

Started byRichard Maher <maher_rjSPAMLESS@hotmail.com>
First post2016-06-17 16:56 +0800
Last post2016-06-23 20:20 +0800
Articles 10 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  HTTP/2 stole my Applet Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2016-06-17 16:56 +0800
    Re: HTTP/2 stole my Applet   VAXman-  @SendSpamHere.ORG - 2016-06-17 10:58 +0000
      Re: HTTP/2 stole my Applet Richard Maher <maherrj@gmail.com> - 2016-06-20 18:01 +0800
        Re: HTTP/2 stole my Applet helbig@asclothestro.multivax.de (Phillip Helbig (undress to reply)) - 2016-06-20 19:28 +0000
        Re: HTTP/2 stole my Applet Qu0ll <qu0ll64@gmail.com> - 2016-06-21 17:39 +1000
        Re: HTTP/2 stole my Applet Richard Maher <maherrj@gmail.com> - 2016-06-22 13:22 +0800
          Re: HTTP/2 stole my Applet   VAXman-  @SendSpamHere.ORG - 2016-06-22 12:39 +0000
    Re: HTTP/2 stole my Applet Qu0ll <qu0ll64@gmail.com> - 2016-06-18 03:36 +1000
    Re: HTTP/2 stole my Applet Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-06-17 23:16 +0200
    The smoking gun Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2016-06-23 20:20 +0800

#30668 — HTTP/2 stole my Applet

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2016-06-17 16:56 +0800
SubjectHTTP/2 stole my Applet
Message-ID<nk0e09$1a68$1@gioia.aioe.org>
For those of you who've been following on along at home all these years, 
and may have a passing interest in what I was talking about, you can 
find the source-code for my Applet at 
https://drive.google.com/folderview?id=0B7Rmd3Rn8_hDY0RkbWwtVV9DdDg&usp=sharing 


For those of you who are new, my Applet facilitated the following 
UA/Browser<->Application Server functionality: -

- Single-Signon without session-hijackable cookie bollocks?

- Single, persistent network connection across multiple active tabs in a

browser instance?

- Full-on synchronous of asynchronous I/O capability?

- 1:M relationship between messages sent to received?

- Retention of server-affinity if/when needed?

- Run-time discovery of Application Servers

- Takes up 0px by 0px GUI real estate

- Dependency injection on the Handshake/authentication logic

- and much much more . . .

Anyway, I may be the last person on the planet to admit Applets are dead 
but I'm sure I'm not the only one who shed a tear at their passing.

For the Javascript people this is how Tier3Client was instantiated: -

       try {
         t3Client = new Tier3Client(
                        "Demo", "http://192.168.1.159/Applets/",
                        2048, 1022, kickOff, epicFail, "ISO-8859-1", 
"N", Tier3Client.GUIAWT,
                        null,Tier3Client.WARNING);
       } catch (err){
             alert((err.description||err.message));
         throw err;
       }

This example can be found in Randomator.html and the object code can be 
found in Tier3Client.js.

Cheers Richard Maher

PS. If anyone knows a half decent lawyer who operates on contingency 
fees please send him my way. HTTP/2 has a lot more than persistent, 
multiplexed, TCP/IP connections but I can tell you that that the 
similarity of algorithms involved is far greater and more substantial 
than the first few bars of "Stairway to Heaven"!

http://www.bbc.com/news/world-us-canada-36546726

[toc] | [next] | [standalone]


#30670

From VAXman- @SendSpamHere.ORG
Date2016-06-17 10:58 +0000
Message-ID<00B0ABEE.100C0E1C@SendSpamHere.ORG>
In reply to#30668
In article <nk0e09$1a68$1@gioia.aioe.org>, Richard Maher <maher_rjSPAMLESS@hotmail.com> writes:
>For those of you who've been following on along at home all these years, 
>and may have a passing interest in what I was talking about, you can 
>find the source-code for my Applet at 
>https://drive.google.com/folderview?id=0B7Rmd3Rn8_hDY0RkbWwtVV9DdDg&usp=sharing 
>
>
>For those of you who are new, my Applet facilitated the following 
>UA/Browser<->Application Server functionality: -
>
>- Single-Signon without session-hijackable cookie bollocks?
>
>- Single, persistent network connection across multiple active tabs in a
>
>browser instance?
>
>- Full-on synchronous of asynchronous I/O capability?
>
>- 1:M relationship between messages sent to received?
>
>- Retention of server-affinity if/when needed?
>
>- Run-time discovery of Application Servers
>
>- Takes up 0px by 0px GUI real estate
>
>- Dependency injection on the Handshake/authentication logic
>
>- and much much more . . .
>
>Anyway, I may be the last person on the planet to admit Applets are dead 
>but I'm sure I'm not the only one who shed a tear at their passing.
>
>For the Javascript people this is how Tier3Client was instantiated: -
>
>       try {
>         t3Client = new Tier3Client(
>                        "Demo", "http://192.168.1.159/Applets/",
>                        2048, 1022, kickOff, epicFail, "ISO-8859-1", 
>"N", Tier3Client.GUIAWT,
>                        null,Tier3Client.WARNING);
>       } catch (err){
>             alert((err.description||err.message));
>         throw err;
>       }
>
>This example can be found in Randomator.html and the object code can be 
>found in Tier3Client.js.
>
>Cheers Richard Maher
>
>PS. If anyone knows a half decent lawyer who operates on contingency 
>fees please send him my way. HTTP/2 has a lot more than persistent, 
>multiplexed, TCP/IP connections but I can tell you that that the 
>similarity of algorithms involved is far greater and more substantial 
>than the first few bars of "Stairway to Heaven"!
>
>http://www.bbc.com/news/world-us-canada-36546726

Trying to turn this into a Spirit-ed debate, RIchard?

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

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


#30696

FromRichard Maher <maherrj@gmail.com>
Date2016-06-20 18:01 +0800
Message-ID<nk8etu$9u5$1@gioia.aioe.org>
In reply to#30670
On 17-Jun-16 6:58 PM, VAXman-@SendSpamHere.ORG wrote:
 > In article <nk0e09$1a68$1@gioia.aioe.org>,
Richard Maher <maher_rjSPAMLESS@hotmail.com> writes:
 >> For those of you who've been following on
 >> along at home all these years,and may have a passing
 >> interest in what I was talking about, you can find the
 >> source-code for my Applet at
 >> https://drive.google.com/folderview?
id=0B7Rmd3Rn8_hDY0RkbWwtVV9DdDg&usp=sharing
 >>
 >>
 >> For those of you who are new, my Applet facilitated the following
 >> UA/Browser<->Application Server functionality: -
 >>
 >> - Single-Signon without session-hijackable cookie bollocks?
 >>
 >> - Single, persistent network connection across multiple active
 >>
 >> tabs in a browser instance?
 >>
 >> - Full-on synchronous of asynchronous I/O capability?
 >>
 >> - 1:M relationship between messages sent to received?
 >>
 >> - Retention of server-affinity if/when needed?
 >>
 >> - Run-time discovery of Application Servers
 >>
 >> - Takes up 0px by 0px GUI real estate
 >>
 >> - Dependency injection on the Handshake/authentication logic
 >>
 >> - and much much more . . .
 >>
 >> Anyway, I may be the last person on the planet to admit Applets
 >> are dead
 >> but I'm sure I'm not the only one who shed a tear at their passing.
 >>
 >> For the Javascript people this is how Tier3Client was instantiated: -
 >>
 >>       try {
 >>         t3Client = new Tier3Client(
 >>                        "Demo", "http://192.168.1.159/Applets/",
 >>                        2048, 1022, kickOff, epicFail, "ISO-8859-1",
 >> "N", Tier3Client.GUIAWT,
 >>                        null,Tier3Client.WARNING);
 >>       } catch (err){
 >>             alert((err.description||err.message));
 >>         throw err;
 >>       }
 >>
 >> This example can be found in Randomator.html and the object code
 >> can be
 >> found in Tier3Client.js.
 >>
 >> Cheers Richard Maher
 >>
 >> PS. If anyone knows a half decent lawyer who operates on contingency
 >> fees please send him my way. HTTP/2 has a lot more than persistent,
 >> multiplexed, TCP/IP connections but I can tell you that that the
 >> similarity of algorithms involved is far greater and more substantial
 >> than the first few bars of "Stairway to Heaven"!
 >>
 >> http://www.bbc.com/news/world-us-canada-36546726
 >
 > Trying to turn this into a Spirit-ed debate, RIchard?
 >

You're just about old enough to have covered those gigs aren't you Brian 
:-) Or was the pony-tail a bit avant garde even for the 60s?
Perhaps you'll have to submit your BoxBrownie as evidence?

Anyway Led Zeppelin are heading for a fall and with over $550million
in revenue to date, it's going to cost 'em big time.
https://www.youtube.com/watch?v=dXMYb93EW2s

If you think the case is ridiculous and doesn't have a hope of getting 
up just look to the precedence of Men at Work "The land down under"
http://www.news.com.au/entertainment/music
/men-at-works-colin-hay-says-down-under-lawsuit-contributed-to-death-of-
his-dad-and-bandmate/news-story/db47d17797386c960b7a7737974ea1ce

I doubt many who didn't attend primary school in Oz know "kookaburra 
sits in the old gum tree" but the similarity with the flute-break is 
uncanny. Well, the judge thought so.

Is all of this happening because people/companies/trusts are just 
feeding a few bars at a time into Google and seeing what it guesses?

I'm happy that all plagiarizing bastards get their comeuppance! The 
corridors
of W3C and IETF are so stacked with left-wing ideologues and sycophants
prostrating themselves before the scribes and pharisees that original 
thought
simply has to be sourced elsewhere :-( How many of them have actually 
cut-code
for a living? Having said that this particular gripe is with Google and 
the authors of SPDY.

Anyway I'd like to thank Arne for all his help in developing the killer
architecture for the Web that sadly came after its time. I owe you a cut 
of everything I made from it.

Feel free to collect your beer anytime :-)

Cheers Richard Maher

PS. Good defense: "If anyone can remember who was at those gigs,
the line-up, or what was played, then they simply weren't there".

PPS. Did no one pause to look at my code and be dumbstruck by its
sheer beauty long enough to stroke my ego?

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


#30699

Fromhelbig@asclothestro.multivax.de (Phillip Helbig (undress to reply))
Date2016-06-20 19:28 +0000
Message-ID<nk9g5m$jf1$1@news.kjsl.com>
In reply to#30696
In article <nk8etu$9u5$1@gioia.aioe.org>, Richard Maher
<maherrj@gmail.com> writes: 

> Anyway Led Zeppelin are heading for a fall and with over $550million
> in revenue to date, it's going to cost 'em big time.
> https://www.youtube.com/watch?v=dXMYb93EW2s

There are many similar cases, e.g. George Harrison's "My Sweet Lord" and
The Chiffons' "He's So Fine".  There is Jethro Tull's "We Used to Know"
and The Eagles' "Hotel California".  (Ian Anderson jokes about the
similarity, especially since the Eagles supported Tull not long before
the song was written, but he overlooks the fact that Don Felder wrote
the music, who was not then in The Eagles.  Sure, it could still be
plagiarism, intentional or not, but the fact that The Eagles supported
Tull is then irrelevant.)  Usually, these are
unintentional---coincidence, both (unconsciously) based on some unknown 
tune, or perhaps one is based on the other, but there is no intentional 
plagiarism.

But Led Zeppelin have a LONG history of out-and-out plagiarism, and have
been sued (and lost) many times, so it wouldn't surprise me here.  
Having said that, the two songs are not THAT similar.

> If you think the case is ridiculous and doesn't have a hope of getting 
> up just look to the precedence of Men at Work "The land down under"
> http://www.news.com.au/entertainment/music
> /men-at-works-colin-hay-says-down-under-lawsuit-contributed-to-death-of-
> his-dad-and-bandmate/news-story/db47d17797386c960b7a7737974ea1ce
> 
> I doubt many who didn't attend primary school in Oz know "kookaburra 
> sits in the old gum tree" but the similarity with the flute-break is 
> uncanny. Well, the judge thought so.

I know the song.  It's not that obscure.  I'm sure everyone in Oz has 
heard it.

> Is all of this happening because people/companies/trusts are just 
> feeding a few bars at a time into Google and seeing what it guesses?

No.

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


#30700

FromQu0ll <qu0ll64@gmail.com>
Date2016-06-21 17:39 +1000
Message-ID<nkaqv4$1npm$1@gioia.aioe.org>
In reply to#30696
On 20/06/2016 20:01, Richard Maher wrote:

[snip]

>> Trying to turn this into a Spirit-ed debate, RIchard?

> Anyway Led Zeppelin are heading for a fall and with over $550million
> in revenue to date, it's going to cost 'em big time.
> https://www.youtube.com/watch?v=dXMYb93EW2s

Well, as a composer myself, I find all these lawsuits rather pointless, 
tedious and (mostly) entirely unwarranted.

In this case, the lineage of the opening chord progression in "Stairway 
to Heaven" could arguably be quite possibly linked to the composer of 
the other progression in question here. But, even if Plant/Page used it 
as a form of "inspiration", their "version" is (in my mind) sufficiently 
different (and actually) better than that from which it was supposedly 
copied to be far out of the reach of greedy litigious morons.

Now, if you take these lawsuits to the ridiculous and yet obvious 
conclusion, imagine how many TENS OF THOUSANDS of such claims would be 
being made by whoever the original composer of the classic 12-bar-blues 
progression was.  Let's face it, it was used in the vast majority of pop 
hits from the 50s and 60s and is STILL being copied chord-for-chord to 
this very day.

Even the incredibly talented and extremely creative and original 
phenomenon that was The Beatles used it a couple of times themselves 
(albeit rather cleverly, as you would expect). The verses of "Can't Buy 
Me Love" are just one such example.

Yet how many people have been sued for using this cliched progression? 
Well, none that I am aware of. But hey, whoever owns the rights to the 
original song could step up right now and become an instant trillionaire!

Really, the day that anyone composes something truly "original" in 
either the pop or rock music genres, I will eat my three day old socks.

Even Gaga *admitted* that "Born This Way" was a *direct copy* of the 
chords used in Madonna's hit "Express Yourself".  Has she been sued??? 
No. She justified it by saying "They were great chords, it was just time 
they got a slightly different melody and new lyrics".

> If you think the case is ridiculous and doesn't have a hope of getting
> up just look to the precedence of Men at Work "The land down under"
> http://www.news.com.au/entertainment/music
> /men-at-works-colin-hay-says-down-under-lawsuit-contributed-to-death-of-
> his-dad-and-bandmate/news-story/db47d17797386c960b7a7737974ea1ce
>
> I doubt many who didn't attend primary school in Oz know "kookaburra
> sits in the old gum tree" but the similarity with the flute-break is
> uncanny. Well, the judge thought so.

This is perhaps the most ludicrous of the entire bunch.

For a start, no one even *knew* that "Kookaburra Sits in the Old Gum 
Tree" was anything other than just a public-domain "folk/cultural" song 
and I can assure you that Men at Work had absolutely no idea that there 
was any possibility of it being "copyrighted" or protected in some way.

And, I can also absolutely assure you that they did not in *any way* 
even use this classic Aussie tune as either a basis for the flute break, 
an inspiration for it or were even thinking about it AT ALL when they 
wrote "Down Under".  The musical differences are so striking that it 
utterly defies logic to actually even permit the litigation to proceed 
(let alone succeed), and, to even lead to the tragic death of a band member.

> PPS. Did no one pause to look at my code and be dumbstruck by its
> sheer beauty long enough to stroke my ego?

I would have - but I wasn't aware your ego needed any "stroking"...

-- 

And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

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


#30707

FromRichard Maher <maherrj@gmail.com>
Date2016-06-22 13:22 +0800
Message-ID<nkd7a4$18ap$1@gioia.aioe.org>
In reply to#30696
On 20/06/2016 6:01 PM, Richard Maher wrote:
>
> PS. Good defense: "If anyone can remember who was at those gigs,
> the line-up, or what was played, then they simply weren't there".

Now they've stolen my defense strategy :-(
http://www.bbc.com/news/entertainment-arts-36592517

>
> PPS. Did no one pause to look at my code and be dumbstruck by its
> sheer beauty long enough to stroke my ego?

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


#30710

From VAXman- @SendSpamHere.ORG
Date2016-06-22 12:39 +0000
Message-ID<00B0AFEA.06F9A109@SendSpamHere.ORG>
In reply to#30707
In article <nkd7a4$18ap$1@gioia.aioe.org>, Richard Maher <maherrj@gmail.com> writes:
>On 20/06/2016 6:01 PM, Richard Maher wrote:
>>
>> PS. Good defense: "If anyone can remember who was at those gigs,
>> the line-up, or what was played, then they simply weren't there".
>
>Now they've stolen my defense strategy :-(
>http://www.bbc.com/news/entertainment-arts-36592517

https://www.youtube.com/watch?v=wlKyWKODn_4



>>
>> PPS. Did no one pause to look at my code and be dumbstruck by its
>> sheer beauty long enough to stroke my ego?
>

Now I'll have to do back to your initial post and have a look.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

I speak to machines with the voice of humanity.

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


#30671

FromQu0ll <qu0ll64@gmail.com>
Date2016-06-18 03:36 +1000
Message-ID<nk1cea$t26$1@gioia.aioe.org>
In reply to#30668
On 17/06/2016 18:56, Richard Maher wrote:

> For those of you who've been following on along at home all these years

Yes, I am one of those (unfortunately).

> and may have a passing interest in what I was talking about

No, I am not one of those (fortunately).

> Anyway, I may be the last person on the planet to admit Applets are dead

Correct.

> but I'm sure I'm not the only one who shed a tear at their passing.

Incorrect.

> PS. If anyone knows a half decent lawyer who operates on contingency
> fees please send him my way. HTTP/2 has a lot more than persistent,
> multiplexed, TCP/IP connections but I can tell you that that the
> similarity of algorithms involved is far greater and more substantial
> than the first few bars of "Stairway to Heaven"!

Yeah right, just like Dalvik resembles Java...

-- 

And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@gmail.com
[Replace the "SixFour" with numbers to email me]

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


#30676

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-06-17 23:16 +0200
Message-ID<2945582.4GhHD3Eqhd@PointedEars.de>
In reply to#30668
Richard Maher <maher_rjSPAMLESS@hotmail.com> whined across 3 newsgroups:

> […]

*PLONK*

F'up2 poster

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.

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


#30711 — The smoking gun

FromRichard Maher <maher_rjSPAMLESS@hotmail.com>
Date2016-06-23 20:20 +0800
SubjectThe smoking gun
Message-ID<nkgk6o$abj$1@gioia.aioe.org>
In reply to#30668
On 17-Jun-16 4:56 PM, Richard Maher wrote:
> For those of you who've been following on along at home all these years,
> and may have a passing interest in what I was talking about, you can
> find the source-code for my Applet at
> https://drive.google.com/folderview?id=0B7Rmd3Rn8_hDY0RkbWwtVV9DdDg&usp=sharing
>
>
> For those of you who are new, my Applet facilitated the following
> UA/Browser<->Application Server functionality: -
>
> - Single-Signon without session-hijackable cookie bollocks?
>
> - Single, persistent network connection across multiple active tabs in a
>
> browser instance?
>
> - Full-on synchronous of asynchronous I/O capability?
>
> - 1:M relationship between messages sent to received?
>
> - Retention of server-affinity if/when needed?
>
> - Run-time discovery of Application Servers
>
> - Takes up 0px by 0px GUI real estate
>
> - Dependency injection on the Handshake/authentication logic
>
> - and much much more . . .
>
> Anyway, I may be the last person on the planet to admit Applets are dead
> but I'm sure I'm not the only one who shed a tear at their passing.
>
> For the Javascript people this is how Tier3Client was instantiated: -
>
>       try {
>         t3Client = new Tier3Client(
>                        "Demo", "http://192.168.1.159/Applets/",
>                        2048, 1022, kickOff, epicFail, "ISO-8859-1", "N",
> Tier3Client.GUIAWT,
>                        null,Tier3Client.WARNING);
>       } catch (err){
>             alert((err.description||err.message));
>         throw err;
>       }
>
> This example can be found in Randomator.html and the object code can be
> found in Tier3Client.js.
>
> Cheers Richard Maher
>
> PS. If anyone knows a half decent lawyer who operates on contingency
> fees please send him my way. HTTP/2 has a lot more than persistent,
> multiplexed, TCP/IP connections but I can tell you that that the
> similarity of algorithms involved is far greater and more substantial
> than the first few bars of "Stairway to Heaven"!
>
> http://www.bbc.com/news/world-us-canada-36546726


The chronology of opportunity
=============================

* BTW I don't claim that they copied my PUSH example 'cos their effort 
is crap :-(


Exhibit A
----------

https://www.chromium.org/spdy/spdy-protocol

Draft 1
Originally published Nov 11, 2009.

Exhibit B
---------

Then try: -
https://www.w3.org/Search/Mail/Public/search?type-index=public-whatwg-archive&index-type=t&keywords=richard%27s&search=Search

and it will reveal my posts to WHATWG Sep thru Nov 2008. If you look at 
some of the names of Google employees participating in those threads I 
think you'll agree who's more than likely in the Library holding the 
Candle-Stick, dagger, and revolver: -

https://lists.w3.org/Archives/Public/public-whatwg-archive/2008Sep/0090.html

 > > > A copy of the Java Applet code is
 > > at: - http://manson.vistech.net/t3$examples/


https://lists.w3.org/Archives/Public/public-whatwg-archive/2008Sep/0094.html

Please see the following for examples of what I am talking about: -

http://manson.vistech.net/t3$examples/demo_client_flex.html
http://manson.vistech.net/t3$examples/demo_client_web.html

In both cases the Username is TIER3_DEMO and the password is QUEUE.

Obviously, you can "view source" for the HTML and Javascript and the Java
Applet and MXML source can be found at
http://manson.vistech.net/t3$examples/


https://lists.w3.org/Archives/Public/public-whatwg-archive/2008Sep/0156.html

Hi David,

Sorry, forgot to mention a UDP Socket "push" technology demo, that I'd also
like to be able to achieve with WebSockets rather than Java Applet Sockets.
Please explain how the functionality employed in the following code could
ever be achieved with the proposed WebSockets: -

Tier3Pager.java
===========

/**
   * Copyight Tier3 Software. All rights reserved.
   *
   * Author: Richard Maher
   *
**/

import java.applet.Applet;
import java.awt.*;
import java.net.*;
import java.io.IOException;
import netscape.javascript.JSObject;
import netscape.javascript.JSException;

public class Tier3Pager extends Applet
{
     private        String         hostName;
     private        JSObject       browser;
     private static MessageThread  socketThread;
     private static Tier3Talk      chat;

     public class MessageThread extends Thread
     {
         private    DatagramSocket socket;
         private    DatagramPacket packet;
         private    String         threadData;

         public MessageThread(String name, String txt) throws Exception
         {
             super(name);

             byte[] buffer;
             threadData = txt;

             String port     = getParameter("PORT");
             String maxBuf   = getParameter("MAXBUF");
             try
                 {
                 if (port == null)
                     socket = new DatagramSocket();
                 else
                     socket = new DatagramSocket(Integer.parseInt(port));

                 if (maxBuf == null)
                     buffer = new byte[512];
                 else
                     buffer = new byte[Integer.parseInt(maxBuf)];

                 packet = new DatagramPacket(buffer, buffer.length);
                 }
             catch (Exception e)
                 {
                 e.printStackTrace();
                 System.out.println("Unable to create UDP Socket");
                 throw new Exception("Message thread could not be created");
                 }

             setDaemon(true);
             start();
         }

         public void shutdown()
         {
             socket.close();
         }

         public int getLocalPort()
         {
             return socket.getLocalPort();
         }

         public void run()
         {
             System.out.println("Started Message thread. ThreadData = " +
threadData);
             String args[] = {"Started Message Thread " + threadData};
             browser.call("alert", args);
             boolean stopThread = false;

         readLoop:
             while (!stopThread)
             {
               try
                   {
                   socket.receive(packet);
                   String received = new String(packet.getData(), 0,
packet.getLength());
                   processMessage(received);
                   }
               catch (SocketException e)
                   {
                   System.out.println("Shutting up shop");
                   stopThread = true;
                   continue readLoop;
                   }
               catch (IOException e)
                   {
                   e.printStackTrace();
                   System.out.println("Unable to retrieve UDP message");
                   }
             }

             System.out.println("Thread run() unit terminating");
         }

         public void processMessage(String msgText)
         {
              int msgType = Integer.parseInt(msgText.substring(0,2));
              switch (msgType){
                case    1:
                              chat.append(msgText.substring(2));
                              break;
                case    2:
                              String args[] = {msgText.substring(2)};
                              try {browser.call("priceUpdate", args);}
                              catch (JSException e)
                              {
                                System.out.println("Error when calling JS
priceUpdate()");
                              }
                              break;
                default:
                              System.out.println("Unknown rec type
"+msgText);
              }
         }
     }

     public void init()
     {
         System.out.println("Initializing. . .");
         hostName = getCodeBase().getHost();

         chat = new Tier3Talk("Tier3 Messages");
         requestFocus();

         browser = JSObject.getWindow(this);

         if (socketThread == null)
         {
           try
               {
               socketThread = new MessageThread("MsgDaemon", "SomeData");
               }
           catch (Exception e)
               {
               e.printStackTrace();
               System.out.println("Could not init Tier3Pager");
               }
         }
     }

     public void alert(String alertText)
     {
         String args[] = {alertText};
         browser.call("alert", args);
     }

     public void destroy()
     {
         if (chat != null)
             chat.dispose();

         boolean stillDying;

         if (socketThread != null){
             socketThread.shutdown();
             do
             {
                 stillDying = false;
                 System.out.println("Joining MessageThread");
                 try {socketThread.join();}
                 catch (InterruptedException e){
                     System.out.println("Interrupted Join");
                     stillDying = true;
                 }
             } while (stillDying);

             socketThread = null;
         }

         System.out.println("Tier3Pager Applet Rundown complete");
         super.destroy();
     }
}

Tier3Talk.java
===========

/**
   * Copyright Tier3 Software. All rights reserved.
   *
   * Author: Richard Maher
   *
**/

import java.awt.*;
import java.awt.event.*;

public class Tier3Talk  extends Frame
                         implements WindowStateListener
{
     TextArea chatPanel  = new TextArea("Server messages will appear
below: -", 10, 50);
     Toolkit  toolkit    = Toolkit.getDefaultToolkit();
     boolean  windowDown = true;

     public Tier3Talk(String heading)
     {
         super(heading);
         setBackground(Color.gray);

         chatPanel.setEditable(false);

         Panel panel = new Panel();
         panel.setLayout(new FlowLayout(FlowLayout.CENTER));
         panel.add(chatPanel);
         add("Center", panel);

         Dimension screenDim = toolkit.getScreenSize();
         pack();
         Dimension windowDim = getSize();
         setLocation((screenDim.width - windowDim.width),(screenDim.height -
windowDim.height));

         setResizable(false);
         addWindowStateListener(this);
         setExtendedState(Frame.ICONIFIED);
         setVisible(true);
     }

     public void append(String newMsg)
     {
         chatPanel.append("\n" + newMsg);
         if (windowDown)
             setExtendedState(Frame.NORMAL);
         toolkit.beep();
     }

     public void windowStateChanged(WindowEvent we)
     {
         switch (we.getNewState())
         {
             case Frame.ICONIFIED:
                 windowDown = true;
                 break;
             case Frame.NORMAL:
                 windowDown = false;
                 break;
             default:
                 System.out.println("Event of no interest" +
we.getNewState());
         }
     }
}

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web