Home > Archive > Java Help > May 2004 > how to connect to IP adress?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
how to connect to IP adress?
|
|
|
| Hi,
First I describe what I can do:
Using PuTTY connect to np. IP=192.168.1.244:5524
with RAW protocol.
I send there a string: "aLOGI 9999 9999<cr><lf>" where 9999 is some 4-digit
number.
Now I describe my problem:
I need to do the same from Java.
I tried to use URL class, but it doesn't work.
Any advices?
I'm just starting my Java learning, so don't be cruel to me ;-))
miro
| |
| Gordon Beaton 2004-05-19, 10:38 am |
| On Wed, 19 May 2004 15:21:41 +0200, miro wrote:
> Using PuTTY connect to np. IP=192.168.1.244:5524 with RAW protocol.
> I send there a string: "aLOGI 9999 9999<cr><lf>" where 9999 is some
> 4-digit number.
>
> Now I describe my problem:
> I need to do the same from Java.
Use a Socket to make the connection:
Socket s = new Socket("192.168.1.244",5524);
Communicate using the InputStream and OutputStream of the Socket,
possibly wrapping them in some kind of Reader and Writer classes
first.
/gordon
--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
| |
| Jeffrey Spoon 2004-05-20, 6:32 pm |
| In message <c8fmke$2eg$1@nemesis.news.tpi.pl>, miro
<miro@optimaforma.pl> writes
>Hi,
>
>First I describe what I can do:
>Using PuTTY connect to np. IP=192.168.1.244:5524
>with RAW protocol.
>I send there a string: "aLOGI 9999 9999<cr><lf>" where 9999 is some 4-digit
>number.
>
>Now I describe my problem:
>I need to do the same from Java.
>I tried to use URL class, but it doesn't work.
>Any advices?
>
>I'm just starting my Java learning, so don't be cruel to me ;-))
>miro
>
>
Try this:
http://java.sun.com/docs/books/tuto.../readingWriting
..html
--
Jeffrey Spoon
| |
|
|
|
|
| Andrew Thompson 2004-05-21, 1:32 pm |
| On Fri, 21 May 2004 16:17:25 GMT, Roedy Green wrote:
> On Fri, 21 May 2004 06:21:35 GMT, Andrew Thompson
...
>
> The other way is to go to http://tinyurl.com
(shrugs) Yeah, yeah, yeah..
> The problem then is people have no clue where they really lead.
...and they disappear after a short time
and are therefore of little use to people
Googling the group, so I do not use them.
Links *I* give are the kind of links that
should be 'Chiselled in Stone'. ;-)
--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
| |
| Jeffrey Spoon 2004-05-21, 6:32 pm |
| In message <17ier6nu88962.iasf74n8drbh$.dlg@40tude.net>, Andrew Thompson
<SeeMySites@www.invalid> writes
>On Thu, 20 May 2004 15:33:05 +0100, Jeffrey Spoon wrote:
>
>
>Great link Jeffrey.. Though Sun does tend to
>have horrifically long links that break in news
>readers. Fortunately you can often fix that by
>wrapping URL's in '<','>'.. E.G.
><http://java.sun.com/docs/books/tuto...ts/readingWriti
>ng.html>
>
>(crosses fingers)
>
I never knew that, good tip. I was too lazy to use tinyurl.
--
Jeffrey Spoon
|
|
|
|
|