06-18-2009, 07:35 AM
|
#1 (permalink)
|
| New Member
Join Date: Jul 2008 Model: 8800 PIN: N/A Carrier: att
Posts: 3
Post Thanks: 0 Thanked 0 Times in 0 Posts
| socket close issue. Please Login to Remove! Hi All, I am developing an applicaiton which uses direct TCP connection to talk to our server, everything works fine until i
cancel a ongoing transaction. by cancel i mean i close a all the input stream and output stream alongwith the socket when
user presses a cancel button displayed on screen while a transaction is going on. the problematic scenario is when user
presses cancel and again start the transaction, at that the whole procedure of getting a new socket, output stream and input
stream repeat but when i try to write something to this new output stream it blocks itself there and the next line below that
never gets executed. and hence no network communication ( i am writing in two chunks i.e first header and then payload while
writing it blocks itself and never comes up again to write the payload and my processing animation goes on foreever).
synchronized(outStream)
{
if(null != outStream)
{
outStream.write(m_data); at this line it get stuck...this is running in a
loop under a thread and my next packet to be
written never gets written on a scoket.
}
if(null != outStream)
outStream.flush();
}
I am kinda stuck here. please help asap.
thanks dcdel. |
| Offline
| |