Hello,

I'm developing a connection tool that supports UDP and serial(RS232)
connections. 
There's an IConnector instance that can be either a NioDatagramConnector or
a SerialConnector. In both cases I'm adding a ProtocolCodecFilter. The
corresponding encoder/decoder instances are working fine (tested with
NioDatagramConnector), but when writing/receiving a message over a serial
session, it seems as the encoder/decoder is not used. The encode() or
doDecode() method is never called. Even the getEncoder() and getDecoder()
methods from ProtocolCodecFactory are not called. 
Is it possible that there’s a bug in SerialSessionImpl that prevents the
usage of my filter? Here’s the code for my SerialConnector initialization:

connector = new SerialConnector();            
address = new SerialAddress("COM1", 115200, DataBits.DATABITS_8,
StopBits.BITS_1, Parity.NONE, FlowControl.NONE);
connector.getSessionConfig().setReadBufferSize(120000);                        
connector.getFilterChain().addLast( "protocol-codec", new
ProtocolCodecFilter(new CommProtocolCodecFactory()) );
connector.setHandler(new InternalIoHandler());
ConnectFuture cf = connector.connect(address);
try {
cf.await();
session = cf.getSession();
} catch (Exception e) {
e.printStackTrace();
}   
WriteFuture wf = session.write(object);

I'm using Mina core and serial bundle from the ASF Maven 2 snapshot
repository (mina-core-2.0.0-M1-20080117.051022-115.jar and
mina-transport-serial-2.0.0-M1-20080124.103130-71.jar)

I would be grateful for any answers.

Kind regards from Berlin,
Konrad

-- 
View this message in context: 
http://www.nabble.com/Mina-serial-communication---filter-not-used--tp15306707s16868p15306707.html
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.

Reply via email to