You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Sungwon Jung <th...@gmail.com> on 2007/09/20 02:47:28 UTC

1 more reveive packet

Hello. I'm using MINA 1.1.2.

I use TextLineCodecFactory like this.

cfg.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new
TextLineCodecFactory( Charset.forName( "EUC-KR" ) ) ) );


and messageReceived() in SessionHandler is like this.

public void messageReceived(IoSession session, Object message) throws
Exception {
	logger.debug( "Suprema message received" );

	// blah blah code
}


and client's send routine is like this.

char sBufSend[ 512 ] = "";
sprintf( sBufSend, "S:REGUSER2:DONE:%d\n", r_user_idx );
if( send( scHost, sBufSend, strlen( sBufSend ), 0 ) < 0 ) {
	printf( "Error (1)\n" );
	return BS_ERR_UNKNOWN;
}

first packet from client is received well.
but server cannot reveive 2nd, 3rd, 4th... message.
what's wrong? client problem? I logged client sent message.

Re: 1 more reveive packet

Posted by Sungwon Jung <th...@gmail.com>.
sorry, my mistake.
I use wrong DB query. so server program is going wrong.

MINA is guiltlessness. :-)


On 9/20/07, Sungwon Jung <th...@gmail.com> wrote:
> Hello. I'm using MINA 1.1.2.
>
> I use TextLineCodecFactory like this.
>
> cfg.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new
> TextLineCodecFactory( Charset.forName( "EUC-KR" ) ) ) );
>
>
> and messageReceived() in SessionHandler is like this.
>
> public void messageReceived(IoSession session, Object message) throws
> Exception {
>         logger.debug( "Suprema message received" );
>
>         // blah blah code
> }
>
>
> and client's send routine is like this.
>
> char sBufSend[ 512 ] = "";
> sprintf( sBufSend, "S:REGUSER2:DONE:%d\n", r_user_idx );
> if( send( scHost, sBufSend, strlen( sBufSend ), 0 ) < 0 ) {
>         printf( "Error (1)\n" );
>         return BS_ERR_UNKNOWN;
> }
>
> first packet from client is received well.
> but server cannot reveive 2nd, 3rd, 4th... message.
> what's wrong? client problem? I logged client sent message.