说明
基本的调用完全和Tcp的一致。直接示例demo
static void Main(string[] args)
{
WSTouchRpcClient client = new WSTouchRpcClient();
client.Handshaked += Client_Handshaked;
client.Setup(new RRQMConfig()
.SetRemoteIPHost("ws://127.0.0.1:5000/wstouchrpc"));
client.ConnectAsync();
while (true)
{
string[] strs = Console.ReadLine().Split(' ');
if (strs.Length != 2)
{
Console.WriteLine("参数不对");
continue;
}
Console.WriteLine(client.Invoke<bool>("TouchRpcWebApplication.RpcProviders.TestServerProvider.Login".ToLower(), null, strs[0], strs[1]));
Console.ReadKey();
}
}
private static void Client_Handshaked(WSTouchRpcClient client, VerifyOptionEventArgs e)
{
client.Logger.Message("成功连接");
}