I am using MonoTouch to develop an app which will connect to remote devices on a network. These devices have data which can be access through http queries.
If I provide a valid IP address to a controller the app works perfectly, however it hangs for a long time if the controller is not on the network. For this reason I thought it would be good to use the Reachability.cs class which can be found here:
https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs
Instead of using google.com as the host, I am using the IP address of the controller. I have read that there is a bug with this class which causes it to not like having "http" at the beginning of the URL. Having now tried numerous things to get this working I am out of ideas.
Do anyone have any suggestions? Perhaps I am reinventing the wheel here.
Having now tried numerous things to get this working I am out of ideas.
From your question it's not clear what issue you're having with the Reachability class. Maybe you could edit it and add more details ? e.g. what you tried so far, how it reacts like: never works, throws/crash, inconsistent results ...
Do anyone have any suggestions?
If your main issue is blocking the UI of your application then you could (and should anyway) do your connection and data transfer asynchronously (or a separate thread) and once completed update your UI (from the main thread).
E.g. using WebClient.DownloadDataAsync
Related
I am trying to write a minifilter that more or less captures everything that happens in the kernel and was wondering if I could also capture "URLs"/network information; I stumbled upon windivert which seems to be using a .sys driver and also another thread which says we cannot get URLs in driver mode which leaves me a bit confused. If it is true then how does windivert do it?
I understand there is something called network redirect under minifilters on learn.microsoft.com which uses a dll and .sys file (same as windivert), but I could not find any resources that can help make me one.
Is there a better way to capture all visited URLs in real time?
Thanks in advance for any help or directions.
You're looking for Windows Filtering Platform and Filtering Platform Callout Drivers, which WinDivert is utilizing. This gives you the data that goes out over the wire, so for plain old HTTP over port 80 you can parse the requests to obtain the URL. This won't work for HTTPS since you're getting encrypted data over the wire; you'd have to implement some kind of MITM interception technique to handle that.
So I'm thinking of building an application that acts like a VPN of sorts. So, the idea is my application should collect all traffic going from the device it is running on and handles them on it's own instead of forwarding them into the internet. My application will forward all this traffic/packets to an external server that performs whatever the original request was intended on. The same should apply in reverse also.
This thread Routing all packets through my program? gave me a few places to start with...
So far my idea is to use a packet capturing library and capture all packets and pass them on to another section of my program where another header is added on top of the existing packets, then sent to my external server. To server parses the header and determines the destination address and action and gets a response. This response is then wrapped with another header and is sent to my application. With help of netfilter PREROUTING hook I can forward the packets to the required application...
So this is as far as I thought of this. But you see I'm relatively new to network concepts and very much interested to move forward. So any suggestions on how-to's, or this might not work instead try this, is welcome. Even if my entire idea is faulty, please convey it. I'm not expecting you to explain things entirely, just point me some stuff that could be useful
And lastly note that the result I'm intending to get out of this is to demonstrate how I can unblock content within an organizational network. So most administrators block based on domains and stuff. So most one won't block connections to servers. But worry not I'm seriously not going to use this. This is just to improve my knowledge and out of my own interest...
So any help is appreciated. Thanks in advance...
My questions concerns gRPC clients using the C core, specifically C++
I've been debugging one of our servers, and I've noticed a certain two-client flow worked when the clients were launched from separate processes (two separate console windows) but not from within an automated test case (which runs within a single process). The flow in question involves two "clients" (channels, basically) which are alive at the same time and concurrently issuing requests to the same server
Digging further, I discovered that in the working flow the server received requests from two different ip:port combinations: 127.0.0.1:xxxx and 127.0.0.1:yyyy. In the failing scenario however, both requests come from the same ip:port.
I create a separate channel for every client, so this behavior confused me. I have a couple of questions
Does gRPC share ports between channels in the same process like this? If not, then I have to imagine there's a bug in my code
If yes to (1), is there any way to avoid this port reuse?
I do see the "grpc.so_reuseport" option in the channel's metadata, and note that it is enabled by default. This seems more related to servers than clients (though perhaps I'm making an arbitrary distinction), but I'll disable it and try things out
EDIT: The so_reuseport option doesn't do anything, but I am on Windows so I should have expected that anyways :/ I also found a related question without any answers here
EDIT 2: The discussion on this question seems promising. Will try it out and report back
This is mentioned/explained in the question I link in edit 2, but the answer is to use
auto metadata = grpc::ChannelArguments();
metadata.SetInt(GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL, 1);
and pass it to grpc::CreateCustomChannel
So I'm building a web app, and I want to emulate a network failure in browser to see if the client side javascript handles it gracefully. I know I can just disconnect my network connection, but that also disconnects my email, pandora, skype, all things that are marginally vital to my non-productivity. Is there an easy way to kill network communication for just one tab in either of these browser? Or (I'm in linux) can I block a single pid from network communication while still allowing the rest (even if it's the same program) through?
Edit: Shoot, I just realized that I'm working on localhost, and that may not apply for what I'm asking for.
Does menu file -> work without connection works for you? It should be in the firefox menu.
You could always use invalid proxy settings! I recall some plugins that let you easily change proxy profiles so you could even have a profile for "dead proxy" and enable ot whenever you want no Internet.
Turns out there are more sophisticated options: a dedicated site blocker for Chrome. That way you could still use other sites that help your non-productivity while still blocking the desired one!
Sorry for i can't precisely specify the title.
I want to ask that i have created a server using ServerSocket class in java. and i am able to run it easily using 127.0.0.1:7896 and can fetch page from the browser. You can check out this using http://stackoverflow.com/questions/4655355/small-http-server-using-java
But when i try to run this with my external ip address it doesn't worked. So can anyone please tell me whether i am conceptually wrong or it is possible. if it is then how to?
Thanks
Are you behind a router or somekind of firewall ? Your own Operating system may be blocking the call.
there is no reason why you shouldnt be able to do it by using the external ip, as long as the DNS knows it and your machine and infrastructure allows the call