Le 15/09/14 16:07, johan a écrit :
> Hi
> I am using Mina as a load test client for testing another softwares response
> times. I send data through the IoSession and I can verify that the public
> void messageSent(IoSession ioSession, Object o) is run in my code.
>
> That other software tries to send back to my test client (I can see that
> from verifying its logs) but I never get into the test client public void
> messageReceived(IoSession ioSession, Object o).
>
> That other software uses a random source port when sending back to the load
> test client and the Mina session seems to be filtering it, ignoring it. I am
> using the following constructor.
>
> ConnectFuture connFuture = connector.connect(new InetSocketAddress(host,
> serverPort),
> new InetSocketAddress("localhost", vehiclePort));
>
> So the other software will send back to me on "localhost, vehiclePort" while
> IT'S source port will be random. Can I make this work in Mina?
I don't see how. You are opening a socket with your remote peer,
defining a couple of IP:port addresses (local and remote hosts). It
opens a dual channel between those two hosts, which are related to the
hosts and port you have defined. If one side decide to use a different
port, then your side of the connection will not receive anything...