You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Brenno Hayden <br...@gmail.com> on 2008/03/14 15:26:46 UTC
TCP no Delay problem
Hello,
i got one problem whith "((SocketSessionConfig) ioAcceptor.getSessionConfig
()).setTcpNoDelay(false)".
When I have one socket client, sending messages continuos to IoAcceptor
without a delay,
Arrives a different message, as can do to get separated?
example. socket client envia 1000 messages simultaneous [53 56 01 02 02 03
03] and the IoHandlerAdapter receives
[53 56 01 02 02 03 03 53 56 01 02 02 03 03 ....] bus i like receives, such
[53 56 01 02 02 03 03] , [53 56 01 02 02 03 03] , [53 56 01 02 02 03 03]
..
..
..
--
________________________
Brenno Hayden F. Dantas
Re: TCP no Delay problem
Posted by Maarten Bosteels <mb...@gmail.com>.
hi Brenno,
see http://mina.apache.org/tutorial-on-protocolcodecfilter-for-mina-2x.html
Maarten
On Fri, Mar 14, 2008 at 4:15 PM, Emmanuel Lecharny <el...@gmail.com>
wrote:
> Brenno Hayden wrote:
> > Then, I have to make parser? To separate?
> Like any protocol, if you can't distinguish the end of a message from
> the beginning of a message, you are dead. So basically, yes, you have to
> "do" something to separate your messages. It can be a special tag at the
> end of your message, or by passing the length of your message, or by
> defining definite length for your message. it's up to you.
>
>
> ItslikespacescommaanddotsinasentenceIfyoudonthavethemdontexpecttheunderlyingprotocoltoaddthemforyou
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
Re: TCP no Delay problem
Posted by Emmanuel Lecharny <el...@gmail.com>.
Brenno Hayden wrote:
> Then, I have to make parser? To separate?
Like any protocol, if you can't distinguish the end of a message from
the beginning of a message, you are dead. So basically, yes, you have to
"do" something to separate your messages. It can be a special tag at the
end of your message, or by passing the length of your message, or by
defining definite length for your message. it's up to you.
ItslikespacescommaanddotsinasentenceIfyoudonthavethemdontexpecttheunderlyingprotocoltoaddthemforyou
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: TCP no Delay problem
Posted by Brenno Hayden <br...@gmail.com>.
Then, I have to make parser? To separate?
On Fri, Mar 14, 2008 at 10:47 AM, Emmanuel Lecharny <el...@gmail.com>
wrote:
> Brenno Hayden wrote:
> > Hello,
> > i got one problem whith "((SocketSessionConfig)
> ioAcceptor.getSessionConfig
> > ()).setTcpNoDelay(false)".
> >
> > When I have one socket client, sending messages continuos to IoAcceptor
> > without a delay,
> > Arrives a different message, as can do to get separated?
> >
> > example. socket client envia 1000 messages simultaneous [53 56 01 02 02
> 03
> > 03] and the IoHandlerAdapter receives
> > [53 56 01 02 02 03 03 53 56 01 02 02 03 03 ....] bus i like receives,
> such
> > [53 56 01 02 02 03 03] , [53 56 01 02 02 03 03] , [53 56 01 02 02 03
> 03]
> > ..
> > ..
> > ..
> >
> >
> setTcpNoDelay simply disable the Naggle algorithm. It does not create a
> 'separation' of your messages. You have to handle that at your protocol
> level.
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
--
________________________
Brenno Hayden F. Dantas
Re: TCP no Delay problem
Posted by Emmanuel Lecharny <el...@gmail.com>.
Brenno Hayden wrote:
> Hello,
> i got one problem whith "((SocketSessionConfig) ioAcceptor.getSessionConfig
> ()).setTcpNoDelay(false)".
>
> When I have one socket client, sending messages continuos to IoAcceptor
> without a delay,
> Arrives a different message, as can do to get separated?
>
> example. socket client envia 1000 messages simultaneous [53 56 01 02 02 03
> 03] and the IoHandlerAdapter receives
> [53 56 01 02 02 03 03 53 56 01 02 02 03 03 ....] bus i like receives, such
> [53 56 01 02 02 03 03] , [53 56 01 02 02 03 03] , [53 56 01 02 02 03 03]
> ..
> ..
> ..
>
>
setTcpNoDelay simply disable the Naggle algorithm. It does not create a
'separation' of your messages. You have to handle that at your protocol
level.
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org