将NIO服务器与IO客户端一起使用

时间:2022-09-05 13:16:16

I have server worked with NIO based on Mina.

我有服务器与基于Mina的NIO合作。

I try to make TCP/IP client for this server using usual java.net.Socket technique. I can successfully establish connection (i.e. org.apache.mina.core.service.IoHandler.sessionOpened invoked on server side after opening socket on client side). But if I try to write some bytes to socket (from client side) I have no any effect on server (i.e. org.apache.mina.core.service.IoHandler.messageReceived doesn't invoked).

我尝试使用通常的java.net.Socket技术为此服务器创建TCP / IP客户端。我可以成功建立连接(即在客户端打开套接字后在服务器端调用的org.apache.mina.core.service.IoHandler.sessionOpened)。但是如果我尝试将一些字节写入socket(从客户端),我对服务器没有任何影响(即org.apache.mina.core.service.IoHandler.messageReceived没有被调用)。

Could you please explain why this is happen and is that possible to send some message to my NIO server from my usual client's Socket-based app?

你能否解释一下为什么会发生这种情况,是否可以从我常用的客户端基于套接字的应用程序向我的NIO服务器发送一些消息?

1 个解决方案

#1


0  

do you installed your IoHandler in the acceptor ?

你在承销商中安装了你的IoHandler吗?

#1


0  

do you installed your IoHandler in the acceptor ?

你在承销商中安装了你的IoHandler吗?