directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Zago <>
Subject [mina] Suggestions for a proxy server
Date Sun, 24 Apr 2005 10:42:20 GMT
Hi Guys,
to understand how mina works, I am building a small proxy server, the
functionality is quite easy, a client connect and send a message, the
server broadcasts the message to all connected clients. I am facing
two main problems:

1) I don't understand if in mina there is a class which keeps all the
opened session by an acceptor. And where I can manage the writing of
the message in all the sessions opened?
I was trying to keep the opened session in a vector inside my
IoHandler class  and writing back the message in dataRead method to
each session in the vector. But it doesn't seem a thread safe way of
managing it.

2) I  have a simple client to send a message, it looks client:
wr = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
I run it many times..and on my server randomly I see my daRead method
called, in the most of the times I see an opened and then immediately
closed session. It seems it's too fast and the server looses the
dataRead event. The server is built like the EchoServer in the
example, with SocketAcceptor and IoThreadPoolFilter. Is it a problem
of some configuration parameters?

Thanks in advance to all..


View raw message