简体   繁体   English

移动网络3g / 4g随机断开与服务器的连接

[英]Mobile network 3g/4g randomly disconnects from the server

I have a simple async client application for android that connects to a server on my desktop. 我有一个简单的Android异步客户端应用程序连接到我桌面上的服务器。 Now over wifi the application works fine(unless the client network is super slow). 现在通过wifi,应用程序工作正常(除非客户端网络超级慢)。 But when I try to use it over the mobile network it randomly disconnects with the classic "connection reset by peer" error. 但是,当我尝试通过移动网络使用它时,它随机地断开了经典的“通过对等连接重置”错误。 I think the highest chance of it happening is connecting and then leaving it for a few seconds to do nothing over the connection. 我认为它发生的最大可能性是连接,然后离开它几秒钟,无法通过连接做任何事情。 But the thing is sometimes it "survives" and happens later on, and maybe one in a hundred times doesn't disconnect at all. 但事情有时它会“幸存”并在以后发生,也许百分之一的事情根本不会断开。 It makes no sense and there are a lot of applications on the appstore that work fine across mobile network so it can't be that hard... 这没有任何意义,appstore上有很多应用程序在移动网络上运行良好,所以它不会那么难......

EDIT: This also happens if i just put my phone on a table, great signal, no movement, or anything that would distrubt the connection. 编辑:如果我只是将手机放在桌子上,信号很好,没有移动或任何会破坏连接的东西,也会发生这种情况。

This is not because of mobile's movement. 这不是因为手机的移动。 You should check your setting in mobile network and keep only one setting 3g or 4g. 您应该在移动网络中检查您的设置,并且只保留一个设置3g或4g。 Don't put this on "Both" connections. 不要把它放在“两个”连接上。 Hope this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android-从移动(3g / 4g)网络连接到本地主机URL - Android - Connecting to localhost URL from mobile (3g/4g) network 如何确定网络类型是 2G、3G 还是 4G - How to determine if network type is 2G, 3G or 4G Android webrtc 不适用于 3g、4g - Android webrtc not working with 3g, 4g Android如何检测2G / 3G / 4G之间的移动连接子类型更改 - Android how to detect Mobile connection subtype changes between 2G/3G/4G 检查3g,4g是否已连接android - Check if 3g,4g is connected android FusedLocationProviderClient 无法通过 3G 或 4G 网络获取 GPS 位置,除非先连接到 WIFI 网络 - FusedLocationProviderClient cannot get GPS location over 3G or 4G network unless first connected to WIFI network 推送通知不适用于3G移动网络 - Push Notification Not Working on 3G mobile Network 如何确定哪个网络接口适用于Android中的Wifi,3G,4G(LTE)和VPN? - How to determine which network interface is for Wifi, 3G, 4G (LTE) & VPN in Android? Android Google Maps v2无法在移动互联网(3g或4g)上运行,但可以在wifi上运行 - Android google maps v2 not working on mobile internet(3g or 4g) but its working on wifi Android仅使用蜂窝(3G,4G,EDGE)数据来处理服务器请求 - Android use only cellular(3G, 4G, EDGE) data for server requests
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM