Forum Xamarin.Forms

SignalR client does not connect when the cell phone is at 3g/4g

Hello guys, I have a problem and I would like to know if anyone has been through something similar.

I'm using SIGNALR to develop a chat application similar to Whatsapp, everything works fine, the point is that I found that when the cell phone is at 3g / 4g I can't establish communication with the server's HUB, this in the Android project. On the Android emulator it even works, but on my phone (Xiaomi MI 9) it doesn't. It displays this error: "unable to complete handshake with the server due to an error: handshake was canceled."

Has anyone ever experienced this?

Best Answer

  • RodrigoGimenezRodrigoGimenez USMember ✭✭
    edited February 26 Accepted Answer

    Hello, I discovered the problem, I use a DNS (http://xpto.com:xxxx/api/) to reach the server, WiFI works well, 3G / 4G does not, I changed the DNS for IP and everything worked .. Then I will investigate further the problem with the DNS.

    Thanks

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai

    I found that when the cell phone is at 3g / 4g I can't establish communication with the server's HUB, ... but on my phone (Xiaomi MI 9) it doesn't.

    Try to make your phone connect to the network the same as the emulator to check if it'll work.

    Do you use a dynamic DNS or something similar and a host name for this? Please make the connect could work with anything outside your local network such as mobile or another PC.

    Similar issue:
    https://stackoverflow.com/questions/43680318/signalr-and-mobile-network-connection


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • Steve1000Steve1000 Member ✭✭✭

    @RodrigoGimenez said:
    Hello guys, I have a problem and I would like to know if anyone has been through something similar.

    I'm using SIGNALR to develop a chat application similar to Whatsapp, everything works fine, the point is that I found that when the cell phone is at 3g / 4g I can't establish communication with the server's HUB, this in the Android project. On the Android emulator it even works, but on my phone (Xiaomi MI 9) it doesn't. It displays this error: "unable to complete handshake with the server due to an error: handshake was canceled."

    Has anyone ever experienced this?

    Does it work on WiFi on the device?

    I had a connectivity error where the domain / server hosting was not configured properly for IPv6. Connecting on WiFi worked OK as that network provided only supported IPv4.

    The other network had IPv6 and because of the incorrect server config, wasn't connecting.

    Not specifically for SignalR but maybe worth checking.

  • RodrigoGimenezRodrigoGimenez USMember ✭✭

    Hello, Wi-Fi works, both at home and on any other network, 4G does not work, I will investigate this IPV6 issue. The service is running on IIS on a Windows Server 2012 that is running on a VPS (Hostinger)

  • RodrigoGimenezRodrigoGimenez USMember ✭✭

    Apparently it is only with Xiaomi phones, I tested with another brand for 4G and it was ... the hard part is to find out what in Xiaomi blocks the connection.

  • YelinzhYelinzh Member, Xamarin Team Xamurai

    You could report this issue to product team of Xiaomi on the related community for help.

  • harrycallumharrycallum Member ✭✭

    May be I am totally wrong about this but I think this is happening because a lot of WhatsApp users have left WhatsApp and moved to Signal and Telegram app all at once and I think the reason is many users have moved at once to Signal app the signal server doesn't manage it. But I have no issue because I am using FMWhatsApp Apk which is a modified version of WhatsApp and it's working perfectly.

  • RodrigoGimenezRodrigoGimenez USMember ✭✭
    edited February 26 Accepted Answer

    Hello, I discovered the problem, I use a DNS (http://xpto.com:xxxx/api/) to reach the server, WiFI works well, 3G / 4G does not, I changed the DNS for IP and everything worked .. Then I will investigate further the problem with the DNS.

    Thanks

  • immortalGoku1452immortalGoku1452 Member ✭✭

    @RodrigoGimenez said:
    Hello guys, I have a problem and I would like to know if anyone has been through something similar.

    I'm using SIGNALR to develop a chat application similar to Whatsapp, everything works fine, the point is that I found that when the cell phone is at 3g / 4g I can't establish communication with the server's HUB, this in the Android project. On the Android emulator it even works, but on my phone (Xiaomi MI 9) it doesn't. It displays this error: "unable to complete handshake with the server due to an error: handshake was canceled."

    Has anyone ever experienced this?

    I think the answer to this question is mentioned in some other posts. However, I had the same issues. Hopefully it got fixed. I used gbwhatsapp also it is a great one.

Sign In or Register to comment.