public override void PacketSend(ISessionFilterChain filterChain, IPacket packet) { if (packet.Buffer.Remaining > 0) { _parentSession.SocketSendAsync(packet, _future); } base.PacketSend(filterChain, packet); }
public override void PacketReceived(ISessionFilterChain filterChain, IPacket packet) { if (packet == null || filterChain.Session != base._session) { base.PacketReceived(filterChain, packet); } else { lock (this) { if (_content == null) { _content = packet.Buffer; _endPoint = packet.EndPoint; } else { IBuffer content = packet.Buffer; if (_content.Remaining < content.Remaining) { IBuffer buffer = BufferFactory.GetBuffer( _content.Position + content.Remaining); buffer.Put(_content.Flip()); _content.Release(); _content = buffer; } _content.Put(content); _content.Flip(); } if (_content != null) { try { base.Recognize(_content, _endPoint); } finally { if (_content.HasRemaining) { _content.Compact(); } else { _content.Release(); _content = null; _endPoint = null; } } } } } }
public override void SessionStateChanged(ISessionFilterChain filterChain) { if (filterChain.Session == base._session && base._session.SessionState == SessionState.Closed) { lock (this) { if (_content != null) { _content.Release(); _content = null; } _endPoint = null; } } base.SessionStateChanged(filterChain); }
public override void PacketReceived(ISessionFilterChain filterChain, IPacket packet) { if (packet == null || filterChain.Session != base._session) { base.PacketReceived(filterChain, packet); } else { IBuffer content = packet.Buffer; if (content != null) { try { base.Recognize(content, packet.EndPoint); } finally { content.Release(); } } } }
public virtual void SessionStateChanged(ISessionFilterChain filterChain) { }
public virtual void SessionTimeout(ISessionFilterChain filterChain) { }
public virtual void PacketSent(ISessionFilterChain filterChain, IPacket packet) { }
public virtual void SessionClosed(ISessionFilterChain filterChain) { }
public override void ExceptionCaught(ISessionFilterChain filterChain, Exception cause) { ((SessionBase)filterChain.Session).SessionCaughtException(cause); base.ExceptionCaught(filterChain, cause); }
public virtual void PacketReceived(ISessionFilterChain filterChain, IPacket packet) { }
public void ObjectSent(ISessionFilterChain filterChain, object obj) { _dispatcher.Dispatch(() => filterChain.ObjectSent(obj)); }
public void SessionStateChanged(ISessionFilterChain filterChain) { _dispatcher.Dispatch(() => filterChain.SessionStateChanged()); }
public virtual void ExceptionCaught(ISessionFilterChain filterChain, Exception exception) { }
public override void ObjectReceived(ISessionFilterChain filterChain, object obj) { ((SessionBase)filterChain.Session).SessionReceivedObject(obj); base.ObjectReceived(filterChain, obj); }
public override void ObjectSent(ISessionFilterChain filterChain, object obj) { ((SessionBase)filterChain.Session).SessionSentObject(obj); base.ObjectSent(filterChain, obj); }
public override void SessionTimeout(ISessionFilterChain filterChain) { //((SessionBase)filterChain.Session).SessionTimeout(); base.SessionTimeout(filterChain); }
public override void SessionStateChanged(ISessionFilterChain filterChain) { ((SessionBase)filterChain.Session).SessionStateChanged(); base.SessionStateChanged(filterChain); }
public void ExceptionCaught(ISessionFilterChain filterChain, Exception cause) { //_dispatcher.Dispatch(filterChain.Session, () => filterChain.ExceptionCaught(cause)); }
public virtual void PacketSend(ISessionFilterChain filterChain, IPacket packet) { filterChain.PacketSend(packet); }
public void PacketSent(ISessionFilterChain filterChain, IPacket packet) { _dispatcher.Dispatch(() => filterChain.PacketSent(packet)); }
public virtual void ObjectReceived(ISessionFilterChain filterChain, object obj) { }
public void SessionTimeout(ISessionFilterChain filterChain) { _dispatcher.Dispatch(() => filterChain.SessionTimeout()); }
public virtual void ObjectSent(ISessionFilterChain filterChain, object obj) { }