Hello,

On Wed, Oct 1, 2008 at 2:20 PM, Lorenzo Bolzani <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a written a service following this article
>
> http://mina.apache.org/tutorial-on-protocolcodecfilter-for-mina-2x.html
>
> and it works perfectly.

Good to hear that you like the tutorial :-)

> Now, on this same channel, I need to send some messages that are not
> replies to client requests.
>
> The system receive an event from a GUI and I need to send a message to
> the client.
>
> Where should I place my session.write() ?
>
> Is it safe to use it outside the callback methods and call it at any
> time?

yes, as long as the session is valid.

> Should I synchronize on something? There is something about this
> I've missed completely?

You don't have to synchronize anything, unless your threads are
sharing non-MINA data structures of course.
MINA will add the WriteRequest to the queue and the IoProcessor
thread(s) will put the message on the wire.

regards,
Maarten

>
> Thanks in advance
>
>
> Bye
>
> Lorenzo
>

Reply via email to