aboutsummaryrefslogtreecommitdiffstats
path: root/proxy/proxy_common.h
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-07-30 15:35:00 -0700
committerDavid 'Digit' Turner <digit@android.com>2010-07-30 15:35:00 -0700
commit9b98dbde344781e93e2bdcfa599428cda2fda41d (patch)
tree984065a5cd8d66a99000096fb2018f3ba7988320 /proxy/proxy_common.h
parent7fd67eba0b961d94a5d6baa8e3c3de37b729f738 (diff)
downloadexternal_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.zip
external_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.tar.gz
external_qemu-9b98dbde344781e93e2bdcfa599428cda2fda41d.tar.bz2
Better detection of incorrect proxy values when starting the emulator.
Change-Id: I344f06fc16e051359669b8fe9b8dcec0ceca377d
Diffstat (limited to 'proxy/proxy_common.h')
-rw-r--r--proxy/proxy_common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/proxy/proxy_common.h b/proxy/proxy_common.h
index 78eddd8..5c5789f 100644
--- a/proxy/proxy_common.h
+++ b/proxy/proxy_common.h
@@ -85,4 +85,16 @@ extern void proxy_manager_poll( fd_set* read_fds,
fd_set* write_fds,
fd_set* err_fds );
+/* this function checks that one can connect to a given proxy. It will simply try to connect()
+ * to it, for a specified timeout, in milliseconds, then close the connection.
+ *
+ * returns 0 in case of success, and -1 in case of error. errno will be set to ETIMEDOUT in
+ * case of timeout, or ECONNREFUSED if the connection is refused.
+ */
+
+extern int proxy_check_connection( const char* proxyname,
+ int proxyname_len,
+ int proxyport,
+ int timeout_ms );
+
#endif /* END */