Le 6 sept. 2011 à 13:10, Jean David Olekhnovitch a écrit : > > Le 6 sept. 2011 à 13:02, Emmanuel Lecharny a écrit : > >> On 9/6/11 12:50 PM, Jean David Olekhnovitch wrote: >>> Hi there, >>> I'm playing with Mina for a while, it's really a great tool, well designed, >>> a real pleasure to use ! >>> >>> Unfortunately, I'm stucking with a problem which is, I'm sure, really >>> stupid, but I can't find any information about that >>> >>> I have to print datas received from a socket in real time, byte after byte >>> >>> my sample is really really simple : >>> IoAcceptor acceptor = new NioSocketAcceptor(); >>> acceptor.getFilterChain().addLast( "logger", new LoggingFilter() ); >>> acceptor.setHandler( new POC() ); >>> acceptor.getSessionConfig().setReadBufferSize( 1 ); >>> acceptor.bind( new InetSocketAddress(2000) ); >>> >>> where POC is a simple IoHandlerAdapter, with a method messageReceived which >>> print datas received byte per byte >>> >>> my client is a simple telnet : >>> telnet localhost 2000 >>> >>> >>> it received datas, but not in real time. I have to press "Enter" to send >>> the datas to my server. And I want to print on the server each character >>> while the user is typing it on his terminal. >> Plain normal. Telnet defaults to 'linemode' in order to reduce the number of >> network packets exchanged. >> Try sending the 'mode character' in telnet before any exchange with the >> server. >> >> > Thanks for your answer. Unfortunately, I forgot to mention that, but I'm > already in character mode : > olekhnov% setenv MODE character > olekhnov% setenv TERM_PROGRAM_VERSION > "12.3.7" > olekhnov% telnet localhost -2000 > Trying ::1... > Connected to localhost. > Escape character is '^]'. > >
ok, got it. It was really stupid : you have to switch to char mode AFTER the connection, not before my two cents...
