mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-22 17:32:23 +00:00
39 lines
869 B
C#
39 lines
869 B
C#
|
using Mina.Filter.Codec;
|
|||
|
using Ninject;
|
|||
|
using Mina.Core.Session;
|
|||
|
|
|||
|
namespace FSO.Server.Protocol.Aries
|
|||
|
{
|
|||
|
public class AriesProtocol : IProtocolCodecFactory
|
|||
|
{
|
|||
|
private IKernel Kernel;
|
|||
|
|
|||
|
public AriesProtocol(IKernel kernel)
|
|||
|
{
|
|||
|
this.Kernel = kernel;
|
|||
|
}
|
|||
|
|
|||
|
private IProtocolDecoder _Decoder;
|
|||
|
|
|||
|
public IProtocolDecoder GetDecoder(IoSession session)
|
|||
|
{
|
|||
|
if (_Decoder == null)
|
|||
|
{
|
|||
|
_Decoder = Kernel.Get<AriesProtocolDecoder>();
|
|||
|
}
|
|||
|
return _Decoder;
|
|||
|
}
|
|||
|
|
|||
|
private IProtocolEncoder _Encoder;
|
|||
|
|
|||
|
public IProtocolEncoder GetEncoder(IoSession session)
|
|||
|
{
|
|||
|
if(_Encoder == null)
|
|||
|
{
|
|||
|
_Encoder = Kernel.Get<AriesProtocolEncoder>();
|
|||
|
}
|
|||
|
return _Encoder;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|