View Single Post
Old 03-26-2008, 05:36 AM   #1 (permalink)
Thumbs Must Hurt
Join Date: Mar 2008
Model: 8820
Carrier: Airtel
Posts: 51
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Stream problem in Blackberry 8820

Please Login to Remove!

Hi Friends,

I have developed an application 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.
Offline   Reply With Quote