예제 #1
0
        public RelayedSocketElement(BindingContext context, NameSettings nameSettings, TokenProvider tokenProvider, SocketSecurityRole socketSecurityMode)
        {
            this.context            = context;
            this.nameSettings       = nameSettings;
            this.tokenProvider      = tokenProvider;
            this.socketSecurityMode = socketSecurityMode;
            ConnectivitySettingsEndpointBehavior connectivitySettingsEndpointBehavior = null;
            ConnectivitySettings     connectivitySetting     = this.context.BindingParameters.Find <ConnectivitySettings>();
            HttpConnectivitySettings httpConnectivitySetting = this.context.BindingParameters.Find <HttpConnectivitySettings>();

            if (connectivitySetting != null || httpConnectivitySetting != null)
            {
                connectivitySettingsEndpointBehavior = new ConnectivitySettingsEndpointBehavior(connectivitySetting, httpConnectivitySetting);
            }
            this.connectionListener = new RelayedSocketListener(this.tokenProvider, this.nameSettings, this.socketSecurityMode, connectivitySettingsEndpointBehavior);
        }
예제 #2
0
 public RelayedConnectionSession(int bufferSize, Uri uri, TokenProvider tokenProvider, SocketSecurityRole socketSecurityMode, Guid id, RelayedSocketListener listener, EventTraceActivity activity)
 {
     this.bufferSize         = bufferSize;
     this.uri                = uri;
     this.tokenProvider      = tokenProvider;
     this.socketSecurityMode = socketSecurityMode;
     this.id       = id;
     this.listener = listener;
     this.Activity = activity;
     if (this.tokenProvider != null)
     {
         this.socketSecurityMode = SocketSecurityRole.SslClient;
     }
     this.messageHelper = new SocketMessageHelper();
     this.mutex         = new object();
 }