Sorry, forget what I just wrote…
I found the bug in my code. Should have checked if the connection is still open 
:-/

Cheers,
Max


On 15.01.2012, at 12:09, Max Leske wrote:

> Hey guys
> 
> I'm having a problem with Socket / SocketStream. When I know that the next 
> packet of data from the server is going to be 10'000 bytes I want to ask the 
> socket for exactly 10'000 bytes of data (I don't care how long it takes). 
> However, the comments in the Socket class suggest that the buffer might not 
> be filled entirely when the message answers. As a consequence, my code fails 
> because the ByteArray sometimes has a number of zero bytes at the end which 
> obviously wasn't expected.
> I also tried to use SocketStream to get around this problem but wasn't 
> successful. Am I supposed to handle this case myself or did I overlook 
> something?
> 
> Cheers,
> Max


Reply via email to