Socket time out question

K

Kid

Hello

Can I change socket timeout many times after connection built ?

Can I use Socket.setSoTimeout anywhere ?

Thank you very much .
 
K

Knute Johnson

Kid said:
Hello

Can I change socket timeout many times after connection built ?
Yes

Can I use Socket.setSoTimeout anywhere ?

It will only be effective if you use it before you block in a read on
the socket.

You can set the timeout, read, set the timeout read ...
 
K

Kid

Hi Knute

Thank you very much .


It will only be effective if you use it before you block in a read on
the socket.

You can set the timeout, read, set the timeout read ...
 
R

Richard Maher

Hi,

Kid said:
Hello

Can I change socket timeout many times after connection built ?

Can I use Socket.setSoTimeout anywhere ?

You can find a useful example of what you're trying to do at: -

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

Username: TIER3_DEMO
Password: QUEUE

(Enter and "*" for the Queue Name and then click Get Job Info)

All the client source files are in: -

http://manson.vistech.net/t3$examples/

And if you look at Tier3Socket.java class you will see that the readMessage
method returns 0 if the Socket Read timed out and the setTimeout method is
invoked all over the place from the queue_lookup.html. I use this strategy
to provide the traditional "Working" message for any initially slow database
queries and to provide an erstwhile blocking socket with the ability to
surrender the event processing thread to the browser for window repaints and
button clicks etc.

A seperate thread with JSObject.call(myLovelyJavascriptFunction) is probably
a more AJAXesque way of handling Socket reads but I haven't had time to come
up with an example, as I'm busy trying to get the Flex FABridge example to
build locally. Maybe someone here has a useful JSObject.call() example? I
certaqinly couldn't find a decent one around :-(

Cheers Richard Maher
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top