SocketImpl.sendUrgentData() & what does "Protected" mean?

R

Richard Maher

Hi,

Does anyone have an example of the SendUrgentData method?

Once again I have to appologize for putting my Java and OO ignorance on
display, but although I was able to do various setOption() and getOption
calls on a SocketImpl I was unable to use the .net.Socket socket(socketImpl)
method on it 'cos it said it couldn't find "Socket()" in the SocketImpl
class, and if I tried to use SocketImpl.connect() it complained that it was
protected. On 2nd glance the .net.Socket(socketImpl) method looks
"protected" as well :-(

So has anyone got an example of Java sending the OOB byte that they can show
me?

If I extend SocketImpl would everything be peachy?

Cheers Richard Maher

PS. Not big on the nuances between Abstract and non-Abstract classes either.
Sorry.
 
H

hiwa

Richard said:
Hi,

Does anyone have an example of the SendUrgentData method?

Once again I have to appologize for putting my Java and OO ignorance on
display, but although I was able to do various setOption() and getOption
calls on a SocketImpl I was unable to use the .net.Socket socket(socketImpl)
method on it 'cos it said it couldn't find "Socket()" in the SocketImpl
class, and if I tried to use SocketImpl.connect() it complained that it was
protected. On 2nd glance the .net.Socket(socketImpl) method looks
"protected" as well :-(

So has anyone got an example of Java sending the OOB byte that they can show
me?

If I extend SocketImpl would everything be peachy?

Cheers Richard Maher

PS. Not big on the nuances between Abstract and non-Abstract classes either.
Sorry.
You don't need to use SocketImpl class unless you intend
to make your custom factory. In an ordinary application,
just use java.net.Socket class.

But again, you seldom need to use sendUrgentData method
in your Java network application if the recipient is also a Java
socket application.

What is the requirement for you to send OOB data?
 
R

Richard Maher

Hi Hiwa,
What is the requirement for you to send OOB data?

I want to have a button that says something like [Stop] after sending a
work request to a server so that if the user gets bored (or some sort of
timeout is triggered) the OOB character is sent to instruct the non-Java
server to abort the attempt.

What is the restriction on you answering the question?

Regards Richard Maher
 
E

EJP

Richard said:
I want to have a button that says something like [Stop] after sending a
work request to a server so that if the user gets bored (or some sort of
timeout is triggered) the OOB character is sent to instruct the non-Java
server to abort the attempt.

So why can't you call Socket.sendUrgentData()?

BTW are you aware that you can't receive the OOB data out-of-line in Java?
 
R

Randolf Richardson

Richard said:
I want to have a button that says something like [Stop] after sending a
work request to a server so that if the user gets bored (or some sort of
timeout is triggered) the OOB character is sent to instruct the non-Java
server to abort the attempt.

So why can't you call Socket.sendUrgentData()?

BTW are you aware that you can't receive the OOB data out-of-line in
Java?

Doesn't java.net.Socket.setOOBInline(boolean) make this possible? Or
have you run some tests that prove otherwise?
 
R

Richard Maher

Hi Esmond,

EJP said:
Richard said:
I want to have a button that says something like [Stop] after sending a
work request to a server so that if the user gets bored (or some sort of
timeout is triggered) the OOB character is sent to instruct the non-Java
server to abort the attempt.

So why can't you call Socket.sendUrgentData()?

Good question. I just looked up the docs for java.net.socket (again) and
there it is. I may have been looking at an old version of the docs but it
says it's been there since 1.4 so my eyes must've let me down, sorry. (I did
read up a bit on Abstract classes and did form the impression that *all*
base methods had to be implemented, so was wondering where it'd got to)
BTW are you aware that you can't receive the OOB data out-of-line in Java?

Yep. As long as I can Send it it is all that matters at the moment.

Thanks.

Cheers Richard Maher
 
E

Esmond Pitt

Randolf said:
Doesn't java.net.Socket.setOOBInline(boolean) make this possible?
> Or have you run some tests that prove otherwise?

No, it makes it possible to receive the data *inline*. If you set this
to 'false' the OOB data is discarded. See the Javadoc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top