public IpcRemotingServer(string channelName, string serviceUri, int port, MarshalByRefObject remotingObject) { IDictionary props = new Hashtable(); SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null); string usersGroup = sid.Translate(typeof(NTAccount)).ToString(); props["authorizedGroup"] = usersGroup; //props["channelName"] = channelName; props["portName"] = port.ToString(); props["exclusiveAddressUse"] = false; this.remotingObject = remotingObject; SecureServerChannelSinkProvider sSink = GetSecureServerSink(); ipcChannel = new IpcServerChannel(props, sSink); if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off) { RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; } RemotingServices.Marshal(remotingObject, serviceUri); }
public TcpRemotingServer(string channelName, string serviceUri, int port, object remotingObject) { this.remotingObject = remotingObject; SecureServerChannelSinkProvider sSink = GetSecureServerSink(); tcpChannel = new TcpServerChannel(channelName, port, sSink); RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; RemotingConfiguration.RegisterWellKnownServiceType(remotingObject.GetType(), serviceUri, WellKnownObjectMode.Singleton); }
public TcpRemotingServer(string channelName, string serviceUri, int port, MarshalByRefObject remotingObject) { this.remotingObject = remotingObject; SecureServerChannelSinkProvider sSink = GetSecureServerSink(); tcpChannel = new TcpServerChannel(channelName, port, sSink); if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off) { RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; } RemotingServices.Marshal(remotingObject, serviceUri); }
public PipeRemotingServer(string channelName, string serviceUri, int port, object remotingObject) { IDictionary props = new Hashtable(); SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null); string usersGroup = sid.Translate(typeof(NTAccount)).ToString(); props["pipe"] = serviceUri; this.remotingObject = remotingObject; SecureServerChannelSinkProvider sSink = GetSecureServerSink(); pipeChannel = new PipeServerChannel(props, sSink); RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; RemotingConfiguration.RegisterWellKnownServiceType(remotingObject.GetType(), serviceUri, WellKnownObjectMode.Singleton); }
private SecureServerChannelSinkProvider GetSecureServerSink() { IDictionary sProps = new Hashtable(); sProps["algorithm"] = "3DES"; sProps["requireSecurity"] = "true"; sProps["connectionAgeLimit"] = "120"; sProps["sweepFrequency"] = "60"; SecureServerChannelSinkProvider sSink = new SecureServerChannelSinkProvider(sProps, null); sSink.OnAuthentication += new EventHandler <AuthenticationEventArgs>(sSink_OnAuthentication); sSink.OnManagementAllowed += new EventHandler <ManagementAllowedEventArgs>(sSink_OnManagementAllowed); BinaryServerFormatterSinkProvider binaryFormatter = new BinaryServerFormatterSinkProvider(); binaryFormatter.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; sSink.Next = binaryFormatter; return(sSink); }
public PipeRemotingServer(string channelName, string serviceUri, int port, MarshalByRefObject remotingObject) { IDictionary props = new Hashtable(); SecurityIdentifier sid = new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null); string usersGroup = sid.Translate(typeof(NTAccount)).ToString(); props["pipe"] = serviceUri; this.remotingObject = remotingObject; SecureServerChannelSinkProvider sSink = GetSecureServerSink(); pipeChannel = new PipeServerChannel(props, sSink); if (RemotingConfiguration.CustomErrorsMode != CustomErrorsModes.Off) { RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off; } RemotingServices.Marshal(remotingObject, serviceUri); }