public LogicalEndPointSkeleton(IEndPointManager endPointManager, EndPointAddress endPoint)
        {
            if (endPointManager == null)
            {
                throw new ArgumentNullException(nameof(endPointManager));
            }

            if (endPoint == default)
            {
                throw new ArgumentDefaultException(nameof(endPoint));
            }

            _endPointManager = endPointManager;

            _logicalEndPoint = _endPointManager.CreateLogicalEndPoint(endPoint);
        }
Пример #2
0
        public IMessageRouter CreateMessageRouter(EndPointAddress endPoint, ISerializedMessageHandler serializedMessageHandler)
        {
            if (endPoint == default)
            {
                throw new ArgumentDefaultException(nameof(endPoint));
            }

            if (serializedMessageHandler == null)
            {
                throw new ArgumentNullException(nameof(serializedMessageHandler));
            }

            if (_logicalEndPoint.EndPoint == endPoint)
            {
                return(CreateMessageRouterInternal(_logicalEndPoint, serializedMessageHandler));
            }

            var logicalEndPoint = _endPointManager.CreateLogicalEndPoint(endPoint);

            return(CreateMessageRouterInternal(logicalEndPoint, serializedMessageHandler));
        }