I'm caught up in weird issue. I'm making web call using below simple code in my .Net Native Android App
var client = new System.Net.WebClient();
var data = client.DownloadString("http://172.217.12.174");
It was all working fine on API 25 until I recently upgraded it to 29.
Issue is it works fine on wifi connection but fails when switched to mobile data. I only see Timeout exception in debug though.
However it works if I put same url in chrome browser on mobile data.
My initial investigation found this is happening for any ip address based url (I have tried with Google.com IP address above and has same issue). So I think its some issue with Webclient. I have Samsung 10+ only to test with mobile connection so not sure if its problem with my device.
Related
I'm running VS2019 community, and I've created the default ASP.NET Core Web API project (ASP.NET Core 5.0), the one with the simple weather forecast example. And I am now trying to connect another computer to the URL. I run the example by using the [application name] in the run dropdown, and not IIS Express.
Both computers are connected via wifi to the same Router.
I do an ipconfig on the server machine to get it's IP (192.168.1.108)
And I have also enabled inbound connections from the ports 5000-5001 in the windows firewall setup
On the "client" machine I try to access the server with :
http://192.168.1.108:5000/swagger/index.html
or
https://192.168.1.108:5001/swagger/index.html
but neither seem to work? The page ends up timing out.
So on the machine running the server, I also completely disabled the windows firewalls (temporally, just to get things working).
But still get the same result?
Have I missed a step?
Maybe this will help you. Try to add IP of your host into Program.cs
var host = new WebHostBuilder().UseUrls("http://192.168.1.108:5000")
I have ASP.NET MVC website that runs on my local sever and I need to check mobile area.
So I decided to connect to it via Android Emulator (AVD)
As I read IIS server reject incoming requests from remote devices.
So from this thread I think I found solution
Post
I make all described on his github and get this
So as I understood it can receive external requests now.
And I tried to make request from AVD (192.168.2.106:3000)
And I get this
So as I understood it got path, but IIS still not receive external request.
Maybe someone faced this problem and can help me solve it?
so i'll try my best to post this properly. I asked this before on unity forums, but i didn't found an answer yet, here is the link if you want it.
I have a working demo of a Server side broadcasting and Client reciving the message parsing and using the info to connect to the server.
NetworkTransport.Init();
NetworkTransport.AddHost(defaultTopology, PORT)
NetworkTransport.StartBroadcastDiscovery(id,broadcastport,..,..)
NetworkTransport.Receive(..,..)
NetworkTransport.Connect(..,..)
etc. I can go on further detail on code if you want it, but as far as its working on PC fine I think the code is fine.
When I try the same with PC as server, Android as Client, if the Android device act as a client, he don't recieve the broadcast from the server but i can connect manually(i know the IP of my local machine) and i can send and recieve messages.(This is okay except for the broadcast problem that would be nice to fix)
If the Android act as Server and PC client, the PC recieves the broadcast but can't connect to the Android neither automatically nor manually.
I tested with 2 Androids an the results are bad too.
The client didn't recieve the broadcast and if I try the manual connection the server didn't recieve the connect event. The main goal is using 2 androids.
I searched for problems with the Network and Unity but i only found some people talking about the Android Manifest but not saying exactly what to do about. If you can point me to the correct direction with this i would apreciate.
Also maybe the Android 6 permissions have something to do with that?
I personally think that the android cant recieve nothing until is conected, so when he acts as Client he don't recieve the broadcast but can connect and then works fine, but as a Server he cant recieve the connection.
Maybe has something to do on Android Ports? I usually use 25001.
Using Unity 5.3.5f1
Thanks and sorry for my poor english.
Edit:
I changed to Unity 5.4 to check about Android 6 permisions and isn't working too.
You have a demo here if you want to try
Is an isolation from another project so maybe you find comented delegates and other stuff.
Yes, it is indeed the Android Manifest. I see no other reason why this is not working. The method permission query is handled changed on Android 6.0. You have to download Unity 5.4 to fix this problem.
I'm using a sms panel in my website which provides me with a api to use, when I'm debugging the system and use it locally it works perfectly but when I publish the website it gives the following error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 87.107.121.54:80
and this is the code I'm using
SendSoapClient client = new SendSoapClient("SendSoap");
ArrayOfString receivers = new ArrayOfString();
receivers .Add("0920xxxxxxx");
ArrayOfString result = client.SendSimpleSMS("username", "password", receivers, "sender number", "message goes here", false);
I've put the call to the web service inside my global.asax file just to check if it works or not and it just doesn't work. what exactly am I doing wrong here ?
P.S: I've used this api service in my other websites which are not mvc projects, but just asp.net website and they all are working fine, this is the first time using it in mvc project.
It appears that the computer you deployed your application to doesn't have network access to the 87.107.121.54 IP address which is where the API is hosted. So talk to your network administrator and make sure that the server on which your ASP.NET MVC application is running has network access to this address. Since it is on port 80, I suppose that there shouldn't be issues with the firewall, but nevertheless, you should check that as well. There's nothing wrong with your code, it's more of an infrastructure and network connectivity problem.
I'm using the code from this article just to try and get something up and running. However, I cannot seem to connect to the web sockets server once it's running.
I have tried forwarding both ports 8080 and 8181, ensuring that they are forwarded using canyouseeme, allowing the ports under my firewall, completely disabling my firewall, trying and forwarding different ports, etc.
Nothing has worked so far. Both the HTML browser page and console server application run just fine with no errors but I keep getting this error message when I try to connect through the HTML page in my browser:
Connecting to ws://localhost:8181/chat ...
Socket closed!
I have never used WebSockets before so I'm not sure if I'm missing something like if I need to install some framework, run some daemon, or what. I'm running Windows 7 64 Bit and using Visual Studio to run the solution. Not sure how to get this to work. Anyone have any ideas?
The server mentioned in that article is likely using the older Hixie protocol. If you are running a recent version of Chrome or Firefox then you are using the newer HyBi/IETF protocol. The article was written in Jun 2010 before the newer protocol was standardized and adopted.
Update:
Fleck looks like a descendant of the code in that article (via Nugget) that supports the old and new protocol variants.