directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Wallace <rwall...@thewallacepack.net>
Subject [seda] Sending reply on connect
Date Tue, 14 Dec 2004 04:19:45 GMT
Hey all,

I need to be able to send a message to the client upon connection.  It's a "Hi,
I'm such-and-such running on suchandsuch.com and I'm ready for a transaction." 
I also need to send a message on disconnect, but that's easier cause that's in
response to a client request.  So, all I need to do in that case is first send
the message then send a DisconnectEvent.

The best way I can think to handle the intial message when a connection is made
is to have the creator of the SEDA server subscribe to ConnectEvents.  But then
in that handler I'll have to handle passing the request into the decode stage
(via whatever it listens for from the EventRouter).

I'm afraid that I'm gonna run into the UnsupportedOperationException("only one
advice supported") in DefaultEventRouter.  Alex, what's the issue here.  I'm
not sure I entirely understand what the comment means.  I would think that you
just want to send the event to each of the subscribers.  Not sure what the
issue there is.  There could be issues later, like in the case I'm talking
about above.  You don't want to try writing before you finish establishing the
connection.

Maybe the easiest way to do this is to have the
TCPInputManager.registerNewConnections() method generate a something like a
ConnectionEstablishedEvent.  What would you all think of that?

Rich

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Mime
View raw message