Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > message from perl script to java applet

Reply
Thread Tools

message from perl script to java applet

 
 
Dirk
Guest
Posts: n/a
 
      03-03-2004
hi !

i want to run a script as a cron job on the server, which detects
serveral things.

according to the status, the user shall be informed by displaying a
message in an applet.

does anybody know how to handle that ? i have read something about
sockets but i don't have the knowledge about it. are there perhaps
some scripts available for this task ?

or maybe there is another easier way to do this ?
i can also work with a frame which is permanently refreshed to receive
messages but that's not a good way i think. or ?

it would be nice if anybody can help me in this case. thanks

regards
dirk
 
Reply With Quote
 
 
 
 
kodo
Guest
Posts: n/a
 
      03-03-2004
maybe you could be a "bit" more specific on what you want to do?

--

greetings,

kodo

[ http://kodo.me.uk ]
 
Reply With Quote
 
 
 
 
Dirk
Guest
Posts: n/a
 
      03-03-2004
kodo <> wrote in message news:<c24uh5$1kp91m$>...
> maybe you could be a "bit" more specific on what you want to do?


thank you that you want to help me

...but i found out how i can do it

the java applet will listen to a socket and the perlscript sends this
message to this socket. so the message can directly displayed in the
applet. i only hava to modify this two parts.

on java side:
import java.net.*;
import java.io.*;

public class Server {

public static void main(String[] args) throws IOException {

String inputLine;

ServerSocket soc = new ServerSocket(6789);
Socket inputsoc = soc.accept();
InputStream is = inputsoc.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader in = new BufferedReader(isr);

while ((inputLine = in.readLine())!=null ) {
System.out.println(inputLine);
}
}
}


on perl side:
use IO::Socket::INET;
$MySocket=new IO::Socket::INET->new(PeerPort=>6789,
Proto=>'tcp',
PeerAddr=>'localhost');
$msg="This is the message";
$MySocket->send($msg);


....but thank you again
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access java applet using java script - limitations Sira Javascript 0 07-29-2008 06:28 AM
display a message that Applet is loading! while applet loads shaillenkumar@gmail.com Javascript 1 06-09-2006 08:24 AM
Java applet failed when I try to load the avi file in my java applet Krista Java 3 09-15-2004 02:53 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57