SignalR-.net-core-android-client icon indicating copy to clipboard operation
SignalR-.net-core-android-client copied to clipboard

DefaultExtension refuses handshake

Open daimaXZ opened this issue 7 years ago • 10 comments

WebSockets: Closed. Code: 1002, Reason: draft Draft_6455 extension: DefaultExtension refuses handshake, Remote: false why?

daimaXZ avatar Jul 26 '18 13:07 daimaXZ

It worked for me after adding:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

and updating asp core to 2.1

ivanov84 avatar Aug 05 '18 17:08 ivanov84

@Gurgen @daimaXZ I Have This Problem Too. Haw to Fix it ?

farzinp7 avatar Aug 15 '18 04:08 farzinp7

@Gurgen @ivanov84 Already I have this permissions, but getting handshake error.(Code: 1002)

santhoshpulliman avatar Sep 10 '18 11:09 santhoshpulliman

@santhoshpulliman After some updates on server or on mobile app I have again this error: WebSockets: Closed. Code: 1000, Reason: , Remote: false I will try to reinstall all stuff.

ivanov84 avatar Sep 18 '18 07:09 ivanov84

@ivanov84 Since new signalr version supports bare websocket connection without connectionId. I raised a pull request to set connectionId API call optional, but @Gurgen seems to be offline when I contacted him.

santhoshpulliman avatar Sep 18 '18 07:09 santhoshpulliman

@santhoshpulliman I used it but the problem still exists. I think it can be connected with logic of connection. For example this code I often see after my request to signalr server.

ivanov84 avatar Sep 18 '18 07:09 ivanov84

@santhoshpulliman it's needed some development in socket library. Please look at this: https://github.com/aspnet/SignalR/issues/2969#issuecomment-422444772

Also I found this: https://github.com/aspnet/SignalR/tree/release/2.2/clients/java/signalr/src/main/java/com/microsoft/aspnet/signalr

I have some feelings that it may be connected with something in socket. If I connect 1st time - I load content without problems. But If I request the second call within 1 minut then "close" event fires.

If you have any idea please share it here. This task is my actual. Thank you in advance.

ivanov84 avatar Sep 19 '18 16:09 ivanov84

@santhoshpulliman I found my mistake. Sorry for the inconvenience. Mistake in my android app architecture. When I call a method from functions in main activity - it's ok. But if I call it from alert - "close" event in mConnection fires. Sorry to all who read it. I can delete these messages if you want. idk how to do.

ivanov84 avatar Sep 19 '18 17:09 ivanov84

Hello. Again me. If someone is interested in how I build architecture, then I answer - abstract base activity from here:

https://github.com/Nilhcem/android-websocket-example/tree/master/websockets-example/src/main/java/com/nilhcem/websockets

ivanov84 avatar Sep 20 '18 00:09 ivanov84

@ivanov84 how you fixed this issue?, the library has no support over 8 months and i'm trying to use it with net core signalr

spardo83 avatar Jan 19 '19 00:01 spardo83