Hi,

Thanks James. Unfortunately that did not work for me.
Don't laugh but I tried both setTcpNoDelay(false) & setTcpNoDelay(true);

Am I making some mistake? If anybody has working code for small message,
would you please share?

///////////////////////////////////////////////////////
//My Client code looks like
        NioSocketConnector connector = new NioSocketConnector();
        ((SocketSessionConfig)
connector.getSessionConfig()).setTcpNoDelay(false);


Thanks,
Ashutosh


On Fri, Aug 20, 2010 at 11:12 PM, James Ring <[email protected]> wrote:

> Hey,
>
> On Fri, Aug 20, 2010 at 9:58 AM, Ashutosh Sharma <[email protected]>
> wrote:
> > Hi Everybody,
> >
> >
> > Thanks for your kind consideration.
> >
> >
> > I have just started using mina to implement server & client for a pub-sub
> > protocol (MQTT) over TCP/IP.  This protocol already defines the PINGREQ &
> > PINGRESP packets to implement heart-beat. Both of these packets are 2
> bytes
> > messages. Client does use long-standing connection and after any problem,
> > try to reconnect after 30 seconds.
> >
> >
> > My problem is as follows
> >
> > 1. Client is able to send other bigger packets(30+ bytes) correctly.
> >
> > 2. But it is not able to send PINGREQ, a 2-byte message.
> >
> > 3. PINGREQ was delivered to the server when client had to send another
> > packet (30+ byte messages).
> >
> > 4. I put ProtocolEncoderOutput.flush() after each write, but it does not
> > work.
>
>
> http://mina.apache.org/faq.html#FAQ-WhydoesSocketConnectorsendseveralmessagesasonemessage%253F
>
> You probably need to disable Nagle's algorithm in your socket session
> config.
>
> Regards,
> James
>

Reply via email to