1#ifndef __JNET__JTCPSOCKET__
2#define __JNET__JTCPSOCKET__
13#if !defined(TCP_KEEPIDLE) && defined(TCP_KEEPALIVE)
14#define TCP_KEEPIDLE TCP_KEEPALIVE
21namespace JPP {
using namespace JNET; }
65 if (((flags & mask) != mask &&
on) ||
66 ((flags & mask) != 0 && !
on) ) {
89 return ((flags & mask) != 0);
189 void connect(
const std::string& hostname,
const int port)
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Hostname and IP address functions.
Base class for interprocess communication.
int getFileDescriptor() const
Get file descriptor.
const sockaddr * getSockaddr() const
Get sockaddr.
void setIPnumber()
Set any IP number.
void setPort(const int port)
Set port number.
void setOption(const int level, const int option, const T value)
Set socket option.
void connect(const JHostname &hostname)
Connect to port on specified host.
void setKeepIdle(const int t_s)
Set the TCP idle time.
JTCPSocket(const int server)
Constructor.
void setKeepCnt(const int count)
Set the TCP idle count.
bool getNonBlocking() const
Get non-blocking of I/O.
void connect(const int ip_number, const int port)
Connect to port on specified host.
void connect(const int port)
Connect to port on local host.
void connect(const std::string &hostname, const int port)
Connect to port on specified host.
void accept(const int server)
Accept connection from a server.
void setKeepIntvl(const int t_s)
Set the TCP interval time.
void setNonBlocking(const bool on)
Set non-blocking of I/O.
bool getTcpNoDelay() const
Get TCP no-delay.
JTCPSocket()
Default constructor.
void setTcpNoDelay(const bool on)
Set TCP no-delay.
Template definition of a multi-dimensional oscillation probability interpolation table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
int getIPnumber()
Get IP number.
std::string getIPaddress()
Get IP address (decimal-dot notation).
Auxiliary data structure for hostname and port number.