这是signalR hub
代码。
如何在android客户端实现具有5个以上参数的signalR hub
客户端方法
public void SendToSpecific(string sSenderSuid, string sSenderName, string sMessage, object objImage, string stoDelimited, string sGroupSuid, long nPriority)
{
string[] arrDelimited = MDLIB.Global.ASGetDelimUnjoinedStrings(stoDelimited);
foreach (string grpEntitysuid in arrDelimited)
{
foreach (string entry in _connections.GetConnections(grpEntitysuid))
{
Clients.Client(entry).broadcastMessage(sSenderSuid, sSenderName, sMessage, objImage, sGroupSuid, DateTime.UtcNow, nPriority, grpEntitysuid);
}
}
}
答案 0 :(得分:0)
I found solution .Actually It was simple
Subscription subscriptionBroadcastMessage = mHubProxy.subscribe(client_broadcastMessage);
subscriptionBroadcastMessage.addReceivedHandler(new Action<JsonElement[]>() {
@Override
public void run(JsonElement[] jsonElements) throws Exception {
System.out.print(jsonElements.toString());
String sSenderSuid = jsonElements[0].getAsString();
String sSenderName = jsonElements[1].getAsString();
String sMessage = jsonElements[2].getAsString();
}
}
});