Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Streaming Problem

843790Mar 26 2008 — edited Mar 31 2008
Hi Friends,

I have developed an application for in Blackberry 8820 which sends data thru WiFi (socket connection) and receives acknowledment.

The process is like:

1. Opened a socket connection
2. Opened an outputstream with respect to socket conn.
3. Opened an inputstream with respect to socket conn.
4. Receives first acknowledment msg from server.
5. Sending data and receiving ack msg.

I have the both input and output streams opened once the connection is done.

Using the streams i am reading and writing the data.

I used the "local"(Within the method) DataInputStream object to read the data. DataInputStream is created by passing inputStream object in constructor of DataInputStream.

The problem is, for reading just 8 bytes it is taking nearly above 10 secs, if dont close DataInputStream after readFully() method.

If i close DataInputStream after readFully() method, reading data is improved like 1 sec but i am getting "ConnectionCloseException".

Please suggest me a solution, how to overcome it.

Thanks in Advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 28 2008
Added on Mar 26 2008
7 comments
94 views