On Nov 30, 2007 10:19 PM, Martin Ritchie <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was just writing some tests that used the InVM Connector and just
> wondered about this (not recent) change to the VmPipeConnector.
>
> Since 1.0.1 The filterChain and sessionCreated events are fired from
> VmPipeConnector.connect.
>
> However, the connector session is initialised BEFORE the acceptor session.
>
> Doesn't this mean that if you have a filter on the acceptor that
> processes the incoming Buffers there could be a message sent from the
> connector sessionCreated method that arrives before the acceptor is
> ready?
If you take a look into the VmPipeFilterChain, there's a queue for such a case:
private void fireEvent(Event e) {
IoSession session = getSession();
EventType type = e.getType();
Object data = e.getData();
if (type == EventType.RECEIVED) {
VmPipeSessionImpl s = (VmPipeSessionImpl) session;
if( sessionOpened && s.getTrafficMask().isReadable() &&
s.getLock().tryLock()) {
...
flushPendingDataQueues( s );
} else {
s.pendingDataQueue.add(data);
}
So, I think it will work fine without causing a dead lock or
messageReceived event to be fired before sessionOpened is fired. Does
it make sense?
Thanks,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6