static void StartServer(AssemblyService service, string name, string uri) { var props = new Hashtable(); props["portName"] = name; var provider = new BinaryServerFormatterSinkProvider(); provider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; var channel = new IpcServerChannel(props, provider); ChannelServices.RegisterChannel(channel, false); RemotingServices.Marshal(service, uri); }
public static int main(string[] args) { if (args.Length != 2) Environment.Exit(1); var channelName = args[0]; var uri = args[1]; var service = new AssemblyService(); startServer(service, channelName, uri); service.waitExit(); return 0; }
static void startServer(AssemblyService service, string name, string uri) { ChannelServices.RegisterChannel(new IpcServerChannel(name), false); RemotingServices.Marshal(service, uri); }