Closed hezhipengzipp closed 6 years ago
Can you show code. How do you connect?
Getting same error, below is my code `public class MainActivity extends AppCompatActivity implements HubConnectionListener, HubEventListener { public static final String CONNECT_URL = "http://192.168.26.214/"; private WebSocketHubConnection connection; private ServerConnection mServerConnection;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
connection = new WebSocketHubConnection(PPVIDEO_CONNECT_URL, "");
connection.connect();
connection.addListener(this);
connection.subscribeToEvent("System", this);
}
@Override
protected void onDestroy() {
super.onDestroy();
connection.disconnect();
}
@Override
public void onConnected() {
System.out.println("Signalr Connected");
}
@Override
public void onDisconnected() {
System.out.println("Signalr Disconnected");
}
@Override
public void onMessage(HubMessage message) {
System.out.println("Signalr Message: " + message);
}
@Override
public void onError(Exception exception) {
System.out.println("Signalr exception: " + exception);
}
@Override
public void onEventMessage(HubMessage message) {
System.out.println("Event Message: " + message.getArguments().toString());
}`
Can you debug connect process and tell me line from where throws RunTimeException?
In WebSocketHubConnection.java line number 160. that is 'onError'callback of WebSocketClient
And what is exception? There is a ex param
some issues in the url. now onClosed callback is invoked. so might be issue at the server. Thanks for the reply
Yes, I think issue on server side, but if any problems, please write here
I am facing an issue when the SignalR server is hosted in Azure. Locally hosted server code is working fine. HubConnectionListener.onDisconnected() is invoked when connecting azure hosted SignalR. The azure hosted thing is working fine in javascript SDK but not in Android. Any extra details should be sent from Android implementation?
Can you provide me your azure host address, I will check?
Thank you @santhoshpulliman , fixed
I use this progrom, java.lang.RuntimeException: Server error, can you tell me ,how to detail with it