I have seen something odd when using MINA for datagram transmission/receipt.
It maybe a bug - or (more likely) something that I dont understand about
using MINA.

Here goes:

I have a simple server that binds to two ports :

acceptor.bind(*new* InetSocketAddress("0.0.0.0",69));
System.*out*.println("Service listening on port " + 69);

acceptor.bind(*new* InetSocketAddress("0.0.0.0",18821));
System.*out*.println("Service listening on port 18821");
In the IOHandler I have the following:

*public* *void* messageReceived(IoSession session, Object message)
*throws*Exception {

 NioSession test = (NioSession) session ;
System.*out*.println(test.getServiceAddress());

}

My test client ONLY sends to port 18821:

*LOGGER*.debug("About to connect to the server...");
ConnectFuture connFuture = connector.connect(*new* InetSocketAddress(
"localhost", 18821));

BUT the debug in my server using the test.getServiceAddress() call always
returns 69 !!!

Is this a bug or correct behaviour (and if so - can you tell me why ?)

Thanks.

Reply via email to