Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-06-2007, 05:39 AM
Member
 
Join Date: Jul 2007
Posts: 40
mathias is on a distinguished road
Non Blocking Network
Hi, I am writing some networking code for an application. I setup a socket, then use its input and output streams to send and receive messages from a server. The I am having is that whenever I read from the socket's input stream, it blocks.

In my application, messages must be able to be sent without delay but they cannot because the inputstream is still trying to read in information. Is there anyway around this?
Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-07-2007, 07:49 AM
Member
 
Join Date: Jul 2007
Posts: 40
baltimore is on a distinguished road
I'm not sure about the type of input stream you are using. If you are using ByteArrayInputStream, every time you are about to read find out the number of bytes available for read without blocking using the available() method.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get URL from network machine Mir Networking 1 04-02-2008 01:08 AM
How can I figure out all the IPs on my network devices coco Networking 3 12-25-2007 05:10 AM
Using Applets for network connection bugger New To Java 0 11-19-2007 06:16 PM
How to classify Network Traaffic consult4u Networking 0 07-30-2007 03:26 PM
ElegantJ Network Bean 1.1 JavaBean Java Announcements 0 07-06-2007 04:06 PM


All times are GMT +3. The time now is 10:56 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org