Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Socket time out question

Thread view: 
Kid - 04 Jan 2008 11:14 GMT
Hello

Can I change socket timeout many times after connection built ?

Can I use Socket.setSoTimeout anywhere ?

Thank you very much .
Knute Johnson - 04 Jan 2008 17:23 GMT
> 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 ...

Signature

Knute Johnson
email s/nospam/knute/

Kid - 04 Jan 2008 23:35 GMT
Hi Knute

Thank you very much .

On 1月5日, 上午1時23分, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> > Hello
>
[quoted text clipped - 18 lines]
>       ------->>>>>>http://www.NewsDemon.com<<<<<<------
> Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Richard Maher - 05 Jan 2008 23:06 GMT
Hi,

> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.