Le 05/05/15 22:38, Abeer Al-Anazi a écrit :
> I identify the client by the client ip and port and call the messagesent
> function:
>
> private static  SocketAddress SwitchId ;
> private static final String HOSTNAME = "localhost";
> private static final int PORT = 9176; // this port that I used in Mina
> socket.
>  @Override
>    public void messageSent(final IoSession session,  Object message)
>              throws Exception
>              {
>
>          final InetSocketAddress d = new InetSocketAddress(HOSTNAME, PORT );
>
>           session.write(SwitchId ,d);
>              }
> but it doesn’t write to client any thing..!
>
>  if I do the message sent like this:
> @Override
>    public void messageSent(final IoSession session,  Object message)
>              throws Exception
>              {
>           session.write(SwitchId);
>              }
> also, it doesn’t write to client any thing..! I mean the messageSent
> function doesn’t fired. in contrast to sessionOpend function.
>
messageSent event is fired only when a message has been sent to a
client. You obviously have to send a message first if you want to do
something like what you do.

What is the logic you are trying to implement ?

Reply via email to