Re: Paket loss with JXTASockets when using JXTASocket.close()

Matthias Horst <[email protected]>
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Hi,

Poole, Paul P1 wrote:

>Just a thought... Why not extend that hack such that the client sends a
>message back to the server saying it has received the notification to
>close, then both can close the connection.  If I am misunderstanding the
>situation, please excuse me... I am still very new to JXTA.
>  
>
me too :)  You understand it right. I implemented your idea and it gives 
me the result. But still this is a "hack". I thought that the principles 
of sending an acknowlege information is already placed somewhere deeper 
in the communication stack (io stream, TCP/IP etc), and must not be 
placed in the application itself. At least it is said that JXTASockets 
are "reliable", aren't they?

Moreover I run a small example from P2PSocket project which is based on 
JXTASockets. As far as I found out especially the close() command is not 
overwritten, such that one calls  the same method as in the original 
JXTASocket API. But to my surprise the problem does not exist!

greetings


>Paul
>
>-----Original Message-----
>From: Vitaly Vainer [mailto:[email protected]] 
>Sent: Tuesday, August 02, 2005 10:24 AM
>To: [email protected]
>Subject: RE: [JXTA user] Paket loss with JXTASockets when using
>JXTASocket.close()
>
>
>Unfortunately I'm getting the same problem. I'm using following hack:
>Server notifies client when he finished and client closes socket, server
>than gets IOException, which is ok if it finished sending data.
>
>Vitaly.
>
>-----Original Message-----
>From: Matthias Horst [mailto:[email protected]] 
>Sent: Tuesday, August 02, 2005 5:05 PM
>To: [email protected]
>Subject: [JXTA user] Paket loss with JXTASockets when using
>JXTASocket.close()
>
>Hi,
>I'm using JXTA 2.3.4. I took the JXTASocket example from the tutorials 
>and modified it in such a way that the communication is vice versa. This
>
>means the client is sending a request and the server responds. To make 
>it simple the client sends 100Bytes and the server echos this message 
>1000 times.
>
>I discovered the following problem: Although the server writes the 
>complete response to the output stream, the clients very often does not 
>receive all the data. Sometimes there arrive only some pakets sometimes 
>(but not very often) everything arrives.
>
>Moreover I found out that if i leave away the socket.close in the server
>
>code, the client receives always everything! Of course then the clients 
>hangs until the read timeout occures.
>
>Server and client code are in the attachments.
>
>Any idea?
>
>  
>


-- 

================================================================

Mit freundlichen Grüßen                      Genius Bytes 
/ best regards                               Software Solutions GmbH
                                                                       
Matthias Horst                               Konrad-Zuse-Str. 16
Dipl. Math.                                  44801 Bochum
Forschung&Entwicklung / R&D

e-mail:  [email protected]               Phone : +49 234 9708 492
web   :  http://www.geniusbytes.com          fax   : +49 234 9708 497

================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.