mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dev@xx" <...@proxiflex.fr>
Subject Re: Multiple Messages being recieved at the same time..
Date Sat, 14 Nov 2009 13:44:00 GMT
Well it is difficult to use Mina if you don't know how socket are working...

When you buy a car, how to drive a car is not explained in the car 
documentation !

JY

----- Original Message ----- 
From: "Mark Wallsgrove" <mark.wallsgrove@googlemail.com>
To: <users@mina.apache.org>
Sent: Saturday, November 14, 2009 1:33 PM
Subject: Re: Multiple Messages being recieved at the same time..


Hey all,

Thanks for the replies.

#Emmanuel
The reason why I asked was due to a lack of understanding of Mina. The
documentation never stated such a fact, so regarded it as being
something odd. But none the less there is no need to be aggressive
about someone being inquisitive.

#Will
Thanks for your explanation. Something like that should be noted in
the documentation. It gives the impression that you only need to deal
with packets being fragmented.

Best Regards,
Mark Wallsgrove


2009/11/13  <will.schick@ntkn.com>:
> Hello Mark
>
> I think it is a bad idea to every trust a "packet" unit in tcp (what you 
> receive in one receive call, or send in one send call) as a unit which you 
> can depend on. TCP works with streams rather than packets, so anything you 
> view as a unit on the sending side is not guaranteed to be a unit on the 
> receiving side, whether that is too much or too little in one receive/send 
> call. A size header or delimiter (or a constant size) is need to determine 
> if you have enough to pull a message from the stream, or (as it sounds in 
> your case), where you should stop reading from the stream for a given 
> message.
>
> Will
>
> ----- Original Message -----
> From: "Mark Wallsgrove" <mark.wallsgrove@googlemail.com>
> To: users@mina.apache.org
> Sent: Friday, November 13, 2009 12:08:11 PM GMT -06:00 US/Canada Central
> Subject: Re: Multiple Messages being recieved at the same time..
>
> Hey,
>
> Thanks for the quick replies. Surely this isn't due to fragmentation?
> Wouldn't fragmentation come down to multiple reads per network packet
> being sent? Which would be fine, but all the messages that are being
> sent fit within a single tcp/ip packet and are being received as a
> single packet.
>
>>>A message is not a "packet". You can have several messages in one 
>>>"packet" or several "packets" for one message.
>
> I have one message per packet, and it is received as one packet also..
> When I view Wireshark it clearly shows a time gap between the two
> receives and the fact the tcp/ip packet isn't full. This isn't a
> problem with it being incomplete, its a problem with it being over
> complete.
>
> From reading the documentation I got the feeling that you have to cope
> with the received data not being complete and not that you have too
> much information.
>
> Best Regards,
> Mark Wallsgrove
>
> 2009/11/13 Mikhail Gerdov <gerdov@gmail.com>:
>> Nature of TCP/IP lead to the fact that MINA can not guaranty that
>> every Send call will result to exactly one Read call.
>> There are ways to fight it by providing custom Decoder to handle 
>> fragmentation.
>> Please read this:
>> http://mina.apache.org/handling-packet-fragementation.html
>> and look at CumulativeProtocolDecoder examples.
>>
>>
>>
>> On Fri, Nov 13, 2009 at 1:12 PM, Mark Wallsgrove
>> <mark.wallsgrove@googlemail.com> wrote:
>>> Mina
>>
>>
>>
>> --
>> Best regards,
>> Mikhail Gerdov mailto:gerdov@gmail.com
>>
>
>
>
> --
> Best Regards,
> Mark Wallsgrove
>



-- 
Best Regards,
Mark Wallsgrove


Mime
View raw message