Results 1 to 2 of 2
  1. #1
    mathias is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default 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.

  2. #2
    baltimore is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    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.

Similar Threads

  1. How to get URL from network machine
    By Mir in forum Networking
    Replies: 1
    Last Post: 04-02-2008, 12:08 AM
  2. Replies: 3
    Last Post: 12-25-2007, 04:10 AM
  3. Using Applets for network connection
    By bugger in forum New To Java
    Replies: 0
    Last Post: 11-19-2007, 05:16 PM
  4. How to classify Network Traaffic
    By consult4u in forum Networking
    Replies: 0
    Last Post: 07-30-2007, 02:26 PM
  5. ElegantJ Network Bean 1.1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-06-2007, 03:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •