Solved

Question about socket/Thread programming...

Posted on 2002-03-08
3
202 Views
Last Modified: 2010-03-31
Hi Guys,

  If a thread calls a blocking socket.read(...), is it possible for another thread to wake up the blocking thread, so socket.read(...) return immediately


(2nd question: Is there any non-blocking socket.read(...)?)
stephen
0
Comment
Question by:zollen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 6851713
Q1. Not that I'm aware of.

Q2. 1.4 added support for non-blocking I/O:
http://java.sun.com/j2se/1.4/docs/guide/nio/
There's also a 3rd party libraries:
http://www.purpletech.com/code.jsp
http://www.cs.berkeley.edu/~mdw/proj/java-nbio/
0
 
LVL 5

Expert Comment

by:nebeker
ID: 6852367
As an alternative to a non-blocking read, you can call "available()" to see if any data is there, before you commit to calling read().
0
 
LVL 92

Expert Comment

by:objects
ID: 6855089
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Glassfish admin console not working 1 86
hashmap order 17 60
What is the use of Forwarding Class in java 1 51
Bitwise and to sum elements 2 51
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question