Base class for bootstrapping new IConnection objects
示例#1
0
        protected AbstractBootstrap(AbstractBootstrap other) : this()
        {
            ReceivedData = other.ReceivedData != null ? (ReceivedDataCallback)other.ReceivedData.Clone() : null;
            ConnectionEstablishedCallback = other.ConnectionEstablishedCallback != null
                ? (ConnectionEstablishedCallback)other.ConnectionEstablishedCallback.Clone()
                : null;
            ConnectionTerminatedCallback = other.ConnectionTerminatedCallback != null
                ? (Net.ConnectionTerminatedCallback)other.ConnectionTerminatedCallback.Clone()
                : null;
            ExceptionCallback = other.ExceptionCallback != null
                ? (ExceptionCallback)other.ExceptionCallback.Clone()
                : null;

            foreach (var option in other.Config.Options)
            {
                Config.SetOption(option.Key, option.Value);
            }

            Encoder = other.Encoder;
            Decoder = other.Decoder;
        }
示例#2
0
        protected AbstractBootstrap(AbstractBootstrap other) : this()
        {
            ReceivedData = other.ReceivedData != null ? (ReceivedDataCallback) other.ReceivedData.Clone() : null;
            ConnectionEstablishedCallback = other.ConnectionEstablishedCallback != null
                ? (ConnectionEstablishedCallback) other.ConnectionEstablishedCallback.Clone()
                : null;
            ConnectionTerminatedCallback = other.ConnectionTerminatedCallback != null
                ? (Net.ConnectionTerminatedCallback) other.ConnectionTerminatedCallback.Clone()
                : null;
            ExceptionCallback = other.ExceptionCallback != null
                ? (ExceptionCallback) other.ExceptionCallback.Clone()
                : null;

            foreach (var option in other.Config.Options)
            {
                Config.SetOption(option.Key, option.Value);
            }

            Encoder = other.Encoder;
            Decoder = other.Decoder;
        }