static void Main(string[] args) { RPCServer server = new RPCServer("127.0.0.1", 3000, 4000, 1024 * 64); server.RegServiceModule(new TalkService()); server.MsgOut += Server_MsgOut; server.Start(); Console.ReadLine(); }
static void Main(string[] args) { RPCServer server = new RPCServer(); server.RegServiceModule(new ServerClass()); server.ReadOutTime = 2000; //设置超时时间 server.Start(); Console.ReadLine(); }
static void Main(string[] args) { LogAction.LogOut += LogAction_LogOut; RPCServer server = new RPCServer("any", 3000, 4000, 1024 * 64, 1024 * 1024); server.RegServiceModule(new TalkService()); server.IsUseTask = false; //如果不搞 C1-->S--->C1 并且是同步访问的 就不要设置为TRUE server.IsCallReturn = false; //服务器不允许调用客户端同步等待函数 server.Start(); Console.ReadLine(); }
public WinServ() { InitializeComponent(); LogAction.LogOut += LogAction_LogOut; Server = new RPCServer(); Server.IsCanConn += Server_IsCanConn; Service.UpdateUserList += Service_UpdateUserList; Server.RegServiceModule(Service); }
static void Main(string[] args) { LogAction.LogOut += LogAction_LogOut; RPCServer server = new RPCServer("127.0.0.1", 3000, 4000, 1024 * 64, 1024 * 1024); server.RegServiceModule(new TalkService()); server.IsUseTask = true; //如果不搞 client call-->Server call(not return)--->client, 并且是同步访问的 就不要设置为TRUE 否则会浪费CPU server.IsCallReturn = true; //服务器是否允许调用客户端同步等待函数 server.Start(); Console.ReadLine(); }
static void Main(string[] args) { LogAction.LogOut += LogAction_LogOut; RPCServer server = new RPCServer(); server.RegServiceModule(new ServerClass()); server.ReadOutTime = 8000; //设置超时时间 server.IsUseTask = true; //为了使用递归函数。 C1->S-->C1-->S 并且是同步访问 server.IsCallReturn = true; server.Start(); Console.ReadLine(); }