Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an app that has been working fine for a couple of years now. Last week I found an issue that ONLY happen (so far) in T Mobile with an S9 phone. The call the TcpClient.Connect is stuck and timeout. Again this just happen in an S9 from T Mobile with the WIFI off, As soon as I connect the WIFI the issue does not happen.

This is my code:

var tcpc = new TcpClient();
tcpc.Connect( remoteAddress, remotePort);

I have tested both versions of Connect with the address (above) and using the IP:

if (System.Text.RegularExpressions.Regex.Match( remoteAddress , @"\d+\.\d+\.\d+\.\d+").Success)
tcpc.Connect(IPAddress.Parse( remoteAddress ), remotePort);

In both cases it fails.

Any idea would be greatly appreciated.

Thanks, Naura

What I have tried:

I've tried with ConnectAsync, running the connect in non UI thread, checking all permissions
Posted
Updated 24-Jul-18 22:17pm

1 solution

This is very probably a network or app configuration problem and not related to code. So we can't help much.

First action is asking the owner of the S9 if he has installed any kind of "security" app which might block specific requests. It might be also a cost reducing app that allows specific requests via WIFI only.

If not, contact T-Mobile and ask them if they are filtering specific requests (you have to provide at least the used contract type and the port number but should add the address / IP as well). This applies especially if the S9 is a T-Mobile branded one.
 
Share this answer
 
Comments
Naurygc 25-Jul-18 17:03pm    
The S9 I am using to test the app is mine and I don't have any firewall or app that can be blocking the request. I've made some changes in the code using TcpClient.ConnectAsync and it works but I have to send the request twice. Do you know why?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900