artdaq  v3_12_02
TCPConnect.hh
Go to the documentation of this file.
1 #ifndef TCPConnect_hh
2 #define TCPConnect_hh
3 #include <netinet/in.h>
4 
5 #include <string>
6 
7 // This file (TCPConnect.hh) was created by Ron Rechenmacher <ron@fnal.gov> on
8 // Sep 15, 2016. "TERMS AND CONDITIONS" governing this file are in the README
9 // or COPYING file. If you do not have such a file, one can be obtained by
10 // contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000.
11 // $RCSfile: .emacs.gnu,v $
12 // rev="$Revision: 1.30 $$Date: 2016/03/01 14:27:27 $";
13 
25 int ResolveHost(char const* host_in, in_addr& addr);
26 
33 int GetIPOfInterface(const std::string& interface_name, in_addr& addr);
46 int AutodetectPrivateInterface(in_addr& addr);
53 int GetInterfaceForNetwork(char const* host_in, in_addr& addr);
61 int ResolveHost(char const* host_in, int dflt_port, sockaddr_in& sin);
70 int TCPConnect(char const* host_in, int dflt_port, int64_t flags = 0, int sndbufsiz = 0);
71 
72 #endif // TCPConnect_hh
int ResolveHost(char const *host_in, in_addr &addr)
Convert a string hostname to a in_addr suitable for socket communication.
Definition: TCPConnect.cc:34
int GetIPOfInterface(const std::string &interface_name, in_addr &addr)
Get the IP address associated with a given interface name.
Definition: TCPConnect.cc:78
int TCPConnect(char const *host_in, int dflt_port, int64_t flags=0, int sndbufsiz=0)
Connect to a host on a given port.
Definition: TCPConnect.cc:377
int GetInterfaceForNetwork(char const *host_in, in_addr &addr)
Convert an IP address to the network address of the interface sharing the subnet mask.
Definition: TCPConnect.cc:224
int AutodetectPrivateInterface(in_addr &addr)
Pick a private IP address on this host.
Definition: TCPConnect.cc:132