Vidalia  0.3.1
net.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file net.h
13 ** \brief Common network I/O and utility functions
14 */
15 
16 #ifndef _NET_H
17 #define _NET_H
18 
19 #include <QHostAddress>
20 
21 /** Attempts a connection to <b>host</b> on <b>port</b>. Returns true if the
22  * connection was successful, or false if the connection attempt failed. */
23 bool net_test_connect(QHostAddress host, quint16 port, int timeout = 250);
24 /** Attempts a connection to <b>server</b>. Returns true if the
25  * connection was successful, or false if the connection attempt failed. */
26 bool socket_test_connect(QString server, int timeout = 250);
27 
28 #endif
29 
net_test_connect
bool net_test_connect(QHostAddress host, quint16 port, int timeout=250)
Definition: net.cpp:25
socket_test_connect
bool socket_test_connect(QString server, int timeout=250)
Definition: net.cpp:37