mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guttikonda <divya_...@yahoo.com>
Subject Re: Problem sending message length in ByteBuffer
Date Thu, 06 Dec 2007 16:19:46 GMT

Thanks Marteen.Actually i tried to write one on my own and succeeded after
seeing your previous suggestion.But it was a little bit different when
compared to this one. I will try to change to this one and see how it goes.

Divya.

Maarten Bosteels wrote:
> 
> Hi Guttikonda,
> 
> I have added a PrefixedStringCodecFactory to the trunk.
> If you're using MINA 1.x, it should be easy to port.
> 
> Maarten
> 
> On Dec 4, 2007 7:26 PM, Niklas Therning <niklas@trillian.se> wrote:
>> guttikonda wrote:
>> > Thanks for all the suggestions.I tried using ByteArrayInputStream and
>> it
>> > worked.
>> > ByteArrayOutputStream baos = new ByteArrayOutputStream();
>> > DataOutputStream writer = new DataOutputStream(baos);
>> > writer.writeUTF(msg);
>> > session.write(ByteBuffer.wrap(baos.toByteArray());
>> >
>> > AND, about the quote saying that "the network layer may decide to
>> deliver
>> > your message in several packets. The result is that you cannot assume
>> > that a ByteBuffer passed in to your IoHandler.messageReceived() method
>> > contains a complete message".Is it always or when using
>> > ByteBuffer.getPrefixedString(...) method only? Please help.
>> >
>>
>> This is always the case. Please have a look at the Protocol Codec
>> tutorial:
>>
>> http://mina.apache.org/tutorial-on-protocolcodecfilter.html
>>
>> and the Reverser and SumUp examples:
>>
>> http://mina.apache.org/documentation.html#Documentation-Examples
>>
>> /Niklas
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-sending-message-length-in-ByteBuffer-tf4939850s16868.html#a14194926
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.


Mime
View raw message