⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server.cs

📁 remoting编程
💻 CS
字号:
/*
  csc c:\RemotingChatRoom\Server\Server.cs
*/

using System;
using System.Collections;

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;



class Server
{
	public static void Main(string[] Args)
	{
		//RemotingConfiguration.Configure("s.config");
		BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
		provider.TypeFilterLevel = TypeFilterLevel.Full;
		IDictionary props = new Hashtable();
		props["port"] = 8080;
		TcpChannel tc = new TcpChannel(props, null, provider);
		ChannelServices.RegisterChannel(tc, false);
		RemotingConfiguration.RegisterWellKnownServiceType(typeof(ChatRoom), "ChatRoomURL", WellKnownObjectMode.Singleton);
		Console.WriteLine("Server .... , Press Enter key to exit.");
		Console.ReadLine();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -