Jpp
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
JNET::JSocket Class Reference

Socket class. More...

#include <JSocket.hh>

Inheritance diagram for JNET::JSocket:
JLANG::JFile JNET::JSocketAddress JLANG::JAbstractFile JLANG::JBinaryInput JLANG::JBinaryOutput JLANG::JComparable< JAbstractFile > JNET::JClient JNET::JServerSocket JNET::JSocketBlocking JNET::JSocketNonblockingReader JNET::JSocketNonblockingWriter JNET::JUDPSocket JNET::JControlHostServer JNET::JLigierObjectIterator< T > JNET::JControlHost KM3NETDAQ::JTarget JNET::JSocketInputChannel< JPrefix_t > JNET::JSocketOutputChannel< JPrefix_t > JNET::JControlHostObjectOutput< JHead_t > JNET::JControlHostObjectOutput< JTail_t > JLOGGER::JControlHostLogger JNET::JControlHostObjectIterator< T > JNET::JControlHostObjectOutput< T > JNET::JControlHostObjectOutput< JTypeList< JHead_t, JNullType > > JNET::JControlHostObjectOutput< JTypeList< JHead_t, JTail_t > > JNET::JControlHostObjectOutput< JTypeList< JHead_t, JTail_t > >

Public Member Functions

 JSocket ()
 Default constructor. More...
 
 JSocket (const int type)
 Constructor. More...
 
 JSocket (const int domain, const int type, const int protocol=0)
 Constructor. More...
 
int shutdown ()
 Shut down socket. More...
 
void setNonBlocking (const bool on)
 Set non-blocking of I/O. More...
 
bool getNonBlocking () const
 Get non-blocking of I/O. More...
 
void setKeepAlive (const bool on)
 Set keep alive of socket. More...
 
bool getKeepAlive () const
 Get keep alive of socket. More...
 
void setKeepIdle (const int t_s)
 Set the TCP idle time. More...
 
void setKeepCnt (const int count)
 Set the TCP idle count. More...
 
void setKeepIntvl (const int t_s)
 Set the TCP interval time. More...
 
void setReuseAddress (const bool on)
 Set reuse address. More...
 
bool getReuseAddress () const
 Get reuse address. More...
 
void setTcpNoDelay (const bool on)
 Set TCP no-delay. More...
 
bool getTcpNoDelay () const
 Get TCP no-delay. More...
 
void setReceiveBufferSize (const int size)
 Set receive buffer size. More...
 
int getReceiveBufferSize () const
 Set receive buffer size. More...
 
void setSendBufferSize (const int size)
 Set send buffer size. More...
 
int getSendBufferSize () const
 Get send buffer size. More...
 
virtual int read (char *buffer, const int length)
 Read data from socket. More...
 
virtual int write (const char *buffer, const int length)
 Write data to socket. More...
 
void accept (const int server)
 Accept connection from a server. More...
 
void connect (const int port)
 Connect to port on local host. More...
 
void connect (const std::string &host_name, const int port)
 Connect to port on specified host. More...
 
void connect (const int ip_number, const int port)
 Connect to port on specified host. More...
 
void close ()
 Close file. More...
 
bool in_avail (JTimeval timeout=JTimeval::min()) const
 Check availability of input. More...
 
bool out_avail (JTimeval timeout=JTimeval::min()) const
 Check availability of output. More...
 
virtual bool good () const
 Check status. More...
 
virtual bool fail () const
 Check status. More...
 
virtual bool bad () const
 Check status. More...
 
virtual bool eof () const
 Check end of file. More...
 
bool less (const JAbstractFile &file) const
 Less than operation. More...
 
int getFileDescriptor () const
 Get file descriptor. More...
 
bool is_open () const
 Get open status. More...
 
const sockaddr * getSockaddr () const
 Get sockaddr. More...
 
sockaddr * getSockaddr ()
 Get sockaddr. More...
 
int getFamily () const
 Get family. More...
 
void setFamily (const int family)
 Set family. More...
 
std::string getHostname () const
 Get host name. More...
 
int getIPnumber () const
 Get IP number. More...
 
void setIPnumber (const int ip_number)
 Set IP number. More...
 
void setIPnumber ()
 Set any IP number. More...
 
int getPort () const
 Get port number. More...
 
void setPort (const int port)
 Set port number. More...
 

Static Public Member Functions

static int sizeOf ()
 Get size of object. More...
 

Static Public Attributes

static const int FILE_CLOSED = -1
 

Protected Member Functions

template<class T >
void setOption (const int level, const int option, const T value)
 Set socket option. More...
 
template<class T >
getOption (const int level, const int option) const
 Get socket option. More...
 

Protected Attributes

int fileDescriptor
 

Private Attributes

int result
 

Detailed Description

Socket class.

Definition at line 42 of file JSocket.hh.

Constructor & Destructor Documentation

◆ JSocket() [1/3]

JNET::JSocket::JSocket ( )
inline

Default constructor.

Definition at line 50 of file JSocket.hh.

50  :
51  JFile()
52  {}

◆ JSocket() [2/3]

JNET::JSocket::JSocket ( const int  type)
inline

Constructor.

Parameters
typesocket type

Definition at line 60 of file JSocket.hh.

60  :
61  JFile(socket(PF_INET, type, 0))
62  {
63  if (getFileDescriptor() < 0) {
64  THROW(JSocketException, "Error opening socket.");
65  }
66 
67  setFamily(AF_INET);
68  }

◆ JSocket() [3/3]

JNET::JSocket::JSocket ( const int  domain,
const int  type,
const int  protocol = 0 
)
inline

Constructor.

Parameters
domaincommunication domain
typesocket type
protocolprotocol

Definition at line 78 of file JSocket.hh.

80  :
81  JFile(socket(domain, type, protocol))
82  {
83  if (getFileDescriptor() < 0) {
84  THROW(JSocketException, "Error opening socket.");
85  }
86 
87  setFamily(domain);
88  }

Member Function Documentation

◆ shutdown()

int JNET::JSocket::shutdown ( )
inline

Shut down socket.

Definition at line 94 of file JSocket.hh.

95  {
96  const int value = ::shutdown(getFileDescriptor(), SHUT_RDWR);
97 
98  close();
99 
100  return value;
101  }

◆ setNonBlocking()

void JNET::JSocket::setNonBlocking ( const bool  on)
inline

Set non-blocking of I/O.

Parameters
ontrue to enable non-blocking; false to disable

Definition at line 109 of file JSocket.hh.

110  {
111  const int flags = fcntl(getFileDescriptor(), F_GETFL, -1);
112  const int mask = FNDELAY;
113 
114  if (flags == -1) {
115  THROW(JSocketException, "Get socket option failed.");
116  }
117 
118  if (((flags & mask) != mask && on) ||
119  ((flags & mask) != 0 && !on) ) {
120 
121  if (fcntl(getFileDescriptor(), F_SETFL, flags ^ mask) < 0) {
122  THROW(JSocketException, "Set socket option failed.");
123  }
124  }
125  }

◆ getNonBlocking()

bool JNET::JSocket::getNonBlocking ( ) const
inline

Get non-blocking of I/O.

Returns
true if enabled non-blocking; else false

Definition at line 133 of file JSocket.hh.

134  {
135  const int flags = fcntl(getFileDescriptor(), F_GETFL, -1);
136  const int mask = FNDELAY;
137 
138  if (flags == -1) {
139  THROW(JSocketException, "Get socket option failed.");
140  }
141 
142  return ((flags & mask) != 0);
143  }

◆ setKeepAlive()

void JNET::JSocket::setKeepAlive ( const bool  on)
inline

Set keep alive of socket.

Parameters
ontrue to enable keep alive; false to disable

Definition at line 151 of file JSocket.hh.

152  {
153  setOption(SOL_SOCKET, SO_KEEPALIVE, int(on ? 1 : 0));
154  }

◆ getKeepAlive()

bool JNET::JSocket::getKeepAlive ( ) const
inline

Get keep alive of socket.

Returns
true if keep alive; else false

Definition at line 162 of file JSocket.hh.

163  {
164  return (getOption<int>(SOL_SOCKET, SO_KEEPALIVE) == 1);
165  }

◆ setKeepIdle()

void JNET::JSocket::setKeepIdle ( const int  t_s)
inline

Set the TCP idle time.

Parameters
t_stime [s]

Definition at line 173 of file JSocket.hh.

174  {
175  setOption(IPROTO_TCP, TCP_KEEPIDLE, t_s);
176  }

◆ setKeepCnt()

void JNET::JSocket::setKeepCnt ( const int  count)
inline

Set the TCP idle count.

Parameters
countcount

Definition at line 184 of file JSocket.hh.

185  {
186  setOption(IPROTO_TCP, TCP_KEEPCNT, count);
187  }

◆ setKeepIntvl()

void JNET::JSocket::setKeepIntvl ( const int  t_s)
inline

Set the TCP interval time.

Parameters
t_stime [s]

Definition at line 195 of file JSocket.hh.

196  {
197  setOption(IPROTO_TCP, TCP_KEEPINTVL, t_s);
198  }

◆ setReuseAddress()

void JNET::JSocket::setReuseAddress ( const bool  on)
inline

Set reuse address.

Parameters
ontrue to enable reuse address; false to disable

Definition at line 206 of file JSocket.hh.

207  {
208  setOption(SOL_SOCKET, SO_REUSEADDR, int(on ? 1 : 0));
209  }

◆ getReuseAddress()

bool JNET::JSocket::getReuseAddress ( ) const
inline

Get reuse address.

Returns
true if enable reuse address; else false

Definition at line 217 of file JSocket.hh.

218  {
219  return (getOption<int>(SOL_SOCKET, SO_REUSEADDR) == 1);
220  }

◆ setTcpNoDelay()

void JNET::JSocket::setTcpNoDelay ( const bool  on)
inline

Set TCP no-delay.

Parameters
ontrue to set TCP no-delay; false to disable

Definition at line 228 of file JSocket.hh.

229  {
230  setOption(IPPROTO_TCP, TCP_NODELAY, int(on ? 1 : 0));
231  }

◆ getTcpNoDelay()

bool JNET::JSocket::getTcpNoDelay ( ) const
inline

Get TCP no-delay.

Returns
true if TCP no-delay; else false

Definition at line 239 of file JSocket.hh.

240  {
241  return (getOption<int>(IPPROTO_TCP, TCP_NODELAY) == 1);
242  }

◆ setReceiveBufferSize()

void JNET::JSocket::setReceiveBufferSize ( const int  size)
inline

Set receive buffer size.

Parameters
sizenumber of bytes

Definition at line 250 of file JSocket.hh.

251  {
252  setOption(SOL_SOCKET, SO_RCVBUF, int(size));
253  }

◆ getReceiveBufferSize()

int JNET::JSocket::getReceiveBufferSize ( ) const
inline

Set receive buffer size.

Returns
number of bytes

Definition at line 261 of file JSocket.hh.

262  {
263  return getOption<int>(SOL_SOCKET, SO_RCVBUF);
264  }

◆ setSendBufferSize()

void JNET::JSocket::setSendBufferSize ( const int  size)
inline

Set send buffer size.

Parameters
sizenumber of bytes

Definition at line 272 of file JSocket.hh.

273  {
274  setOption(SOL_SOCKET, SO_SNDBUF, int(size));
275  }

◆ getSendBufferSize()

int JNET::JSocket::getSendBufferSize ( ) const
inline

Get send buffer size.

Returns
number of bytes

Definition at line 283 of file JSocket.hh.

284  {
285  return getOption<int>(SOL_SOCKET, SO_SNDBUF);
286  }

◆ read()

virtual int JNET::JSocket::read ( char *  buffer,
const int  length 
)
inlinevirtual

Read data from socket.

This method handles I/O errors in such a way that:

  1. the return value is set to zero if no data are read;
  2. an exception is thrown in case of a fatal error;
Parameters
bufferbuffer
lengthnumber of bytes to read
Returns
number of bytes actually read

Reimplemented from JLANG::JFile.

Reimplemented in JNET::JSocketBlocking.

Definition at line 300 of file JSocket.hh.

301  {
302  int pos = JFile::read(buffer, length);
303 
304  if (pos == 0) {
305 
306  THROW(JSocketException, "Socket read failed.");
307 
308  } else if (pos < 0) {
309 
310  switch (errno) {
311 
312  case EINTR:
313  case EWOULDBLOCK:
314  //case EAGAIN:
315  break;
316 
317  default:
318  THROW(JSocketException, "Socket read error.");
319  }
320 
321  pos = 0;
322  }
323 
324  return pos;
325  }

◆ write()

virtual int JNET::JSocket::write ( const char *  buffer,
const int  length 
)
inlinevirtual

Write data to socket.

This method handles I/O errors in such a way that:

  1. the return value is set to zero if no data are written;
  2. an exception is thrown in case of a fatal error;
Parameters
bufferbuffer
lengthnumber of bytes to write
Returns
number of bytes actually written

Reimplemented from JLANG::JFile.

Reimplemented in JNET::JSocketBlocking.

Definition at line 339 of file JSocket.hh.

340  {
341  int pos = JFile::write(buffer, length);
342 
343  if (pos == 0) {
344 
345  THROW(JSocketException, "Socket write failed.");
346 
347  } else if (pos < 0) {
348 
349  switch (errno) {
350 
351  case EINTR:
352  case EWOULDBLOCK:
353  //case EAGAIN:
354  break;
355 
356  default:
357  THROW(JSocketException, "Socket write error.");
358  }
359 
360  pos = 0;
361  }
362 
363  return pos;
364  }

◆ accept()

void JNET::JSocket::accept ( const int  server)
inline

Accept connection from a server.

Parameters
serverfile descriptor of server socket

Definition at line 372 of file JSocket.hh.

373  {
374  socklen_t size = sizeof(sockaddr_in);
375  fileDescriptor = ::accept(server, getSockaddr(), &size);
376  }

◆ connect() [1/3]

void JNET::JSocket::connect ( const int  port)
inline

Connect to port on local host.

Parameters
portport number

Definition at line 384 of file JSocket.hh.

385  {
386  connect(INADDR_ANY, port);
387  }

◆ connect() [2/3]

void JNET::JSocket::connect ( const std::string &  host_name,
const int  port 
)
inline

Connect to port on specified host.

Parameters
host_namehost name
portport number

Definition at line 396 of file JSocket.hh.

397  {
398  connect(JSYSTEM::getIPnumber(host_name), port);
399  }

◆ connect() [3/3]

void JNET::JSocket::connect ( const int  ip_number,
const int  port 
)
inline

Connect to port on specified host.

Parameters
ip_numberIP number
portport number

Definition at line 408 of file JSocket.hh.

409  {
410  setIPnumber(ip_number);
411  setPort(port);
412 
413  if (::connect(getFileDescriptor(), getSockaddr(), sizeof(sockaddr_in)) < 0) {
414  THROW(JSocketException, "Socket connection failed.");
415  }
416  }

◆ setOption()

template<class T >
void JNET::JSocket::setOption ( const int  level,
const int  option,
const T  value 
)
inlineprotected

Set socket option.

Parameters
levellevel
optionoption
valuevalue

Definition at line 428 of file JSocket.hh.

429  {
430  socklen_t size = sizeof(T);
431 
432  if (setsockopt(getFileDescriptor(), level, option, &value, size) < 0) {
433  THROW(JSocketException, "Set socket option failed.");
434  }
435  }

◆ getOption()

template<class T >
T JNET::JSocket::getOption ( const int  level,
const int  option 
) const
inlineprotected

Get socket option.

Parameters
levellevel
optionoption
Returns
value

Definition at line 446 of file JSocket.hh.

447  {
448  T value;
449  socklen_t size = sizeof(T);
450 
451  if (getsockopt(getFileDescriptor(), level, option, &value, &size) < 0) {
452  THROW(JSocketException, "Get socket option failed.");
453  }
454 
455  return value;
456  }

◆ close()

void JLANG::JFile::close ( )
inlineinherited

Close file.

Definition at line 55 of file JFile.hh.

56  {
57  if (fileDescriptor != FILE_CLOSED) {
58 
60 
62  result = 0;
63  }
64  }

◆ in_avail()

bool JLANG::JFile::in_avail ( JTimeval  timeout = JTimeval::min()) const
inlineinherited

Check availability of input.

This method returns true if at least one byte can be read without blocking.

Parameters
timeouttimeout
Returns
true if ready to read; else false

Definition at line 100 of file JFile.hh.

101  {
102  return JFileDescriptorMask(*this).in_avail(timeout);
103  }

◆ out_avail()

bool JLANG::JFile::out_avail ( JTimeval  timeout = JTimeval::min()) const
inlineinherited

Check availability of output.

This method returns true if at least one byte can be written without blocking.

Parameters
timeouttimeout
Returns
true if ready to write; else false

Definition at line 113 of file JFile.hh.

114  {
115  return JFileDescriptorMask(*this).out_avail(timeout);
116  }

◆ good()

virtual bool JLANG::JFile::good ( ) const
inlinevirtualinherited

Check status.

Returns
true if last I/O operation successful; else false

Definition at line 124 of file JFile.hh.

125  {
126  return is_open() && !eof() && !bad();
127  }

◆ fail()

virtual bool JLANG::JFile::fail ( ) const
inlinevirtualinherited

Check status.

Returns
true if last I/O operation caused logical error; else false

Definition at line 135 of file JFile.hh.

136  {
137  return result == 0;
138  }

◆ bad()

virtual bool JLANG::JFile::bad ( ) const
inlinevirtualinherited

Check status.

Returns
true if last I/O operation caused read/write error; else false

Definition at line 146 of file JFile.hh.

147  {
148  return fail();
149  }

◆ eof()

virtual bool JLANG::JFile::eof ( ) const
inlinevirtualinherited

Check end of file.

Returns
true if end of file; else false

Definition at line 157 of file JFile.hh.

158  {
159  return result == EOF;
160  }

◆ less()

bool JLANG::JAbstractFile::less ( const JAbstractFile file) const
inlineinherited

Less than operation.

Parameters
fileJAbstractFile to be compared
Returns
true if this file descriptor is less; else false

Definition at line 64 of file JAbstractFile.hh.

65  {
66  return getFileDescriptor() < file.getFileDescriptor();
67  }

◆ getFileDescriptor()

int JLANG::JAbstractFile::getFileDescriptor ( ) const
inlineinherited

Get file descriptor.

Returns
file descriptor

Definition at line 75 of file JAbstractFile.hh.

76  {
77  return fileDescriptor;
78  }

◆ is_open()

bool JLANG::JAbstractFile::is_open ( ) const
inlineinherited

Get open status.

Definition at line 84 of file JAbstractFile.hh.

85  {
86  return fileDescriptor != FILE_CLOSED;
87  }

◆ getSockaddr() [1/2]

const sockaddr* JNET::JSocketAddress::getSockaddr ( ) const
inlineinherited

Get sockaddr.

Returns
pointer to sockaddr structure

Definition at line 44 of file JSocketAddress.hh.

45  {
46  return (const sockaddr*) static_cast<const sockaddr_in*>(this);
47  }

◆ getSockaddr() [2/2]

sockaddr* JNET::JSocketAddress::getSockaddr ( )
inlineinherited

Get sockaddr.

Returns
pointer to sockaddr structure

Definition at line 55 of file JSocketAddress.hh.

56  {
57  return (sockaddr*) static_cast<sockaddr_in*>(this);
58  }

◆ getFamily()

int JNET::JSocketAddress::getFamily ( ) const
inlineinherited

Get family.

Returns
family

Definition at line 66 of file JSocketAddress.hh.

67  {
68  return sin_family;
69  }

◆ setFamily()

void JNET::JSocketAddress::setFamily ( const int  family)
inlineinherited

Set family.

Parameters
familyfamily

Definition at line 77 of file JSocketAddress.hh.

78  {
79  sin_family = family;
80  }

◆ getHostname()

std::string JNET::JSocketAddress::getHostname ( ) const
inlineinherited

Get host name.

Returns
host name

Definition at line 88 of file JSocketAddress.hh.

89  {
90  return JSYSTEM::getHostname(this->getIPnumber());
91  }

◆ getIPnumber()

int JNET::JSocketAddress::getIPnumber ( ) const
inlineinherited

Get IP number.

Returns
IP number

Definition at line 99 of file JSocketAddress.hh.

100  {
101  return sin_addr.s_addr;
102  }

◆ setIPnumber() [1/2]

void JNET::JSocketAddress::setIPnumber ( const int  ip_number)
inlineinherited

Set IP number.

Parameters
ip_numberIP number

Definition at line 110 of file JSocketAddress.hh.

111  {
112  sin_addr.s_addr = ip_number;
113  }

◆ setIPnumber() [2/2]

void JNET::JSocketAddress::setIPnumber ( )
inlineinherited

Set any IP number.

Definition at line 119 of file JSocketAddress.hh.

120  {
121  sin_addr.s_addr = htonl(INADDR_ANY);
122  }

◆ getPort()

int JNET::JSocketAddress::getPort ( ) const
inlineinherited

Get port number.

Returns
port number

Definition at line 130 of file JSocketAddress.hh.

131  {
132  return ntohs(this->sin_port);
133  }

◆ setPort()

void JNET::JSocketAddress::setPort ( const int  port)
inlineinherited

Set port number.

Parameters
portport number

Definition at line 141 of file JSocketAddress.hh.

142  {
143  if (port >= 0 && port <= std::numeric_limits<u_short>::max())
144  sin_port = htons((u_short) port);
145  else
146  THROW(JCastException, "JSocketAddress::setPort() illegal value.");
147  }

◆ sizeOf()

static int JNET::JSocketAddress::sizeOf ( )
inlinestaticinherited

Get size of object.

Returns
number of bytes

Definition at line 155 of file JSocketAddress.hh.

156  {
157  return sizeof(sockaddr_in);
158  }

Member Data Documentation

◆ result

int JLANG::JFile::result
privateinherited

Definition at line 164 of file JFile.hh.

◆ FILE_CLOSED

const int JLANG::JAbstractFile::FILE_CLOSED = -1
staticinherited

Definition at line 27 of file JAbstractFile.hh.

◆ fileDescriptor

int JLANG::JAbstractFile::fileDescriptor
protectedinherited

Definition at line 91 of file JAbstractFile.hh.


The documentation for this class was generated from the following file:
JLANG::JAbstractFile::getFileDescriptor
int getFileDescriptor() const
Get file descriptor.
Definition: JAbstractFile.hh:75
JNET::JSocketAddress::getSockaddr
const sockaddr * getSockaddr() const
Get sockaddr.
Definition: JSocketAddress.hh:44
JLANG::JFile::read
virtual int read(char *buffer, const int length)
Read data from file.
Definition: JFile.hh:74
JNET::JSocket::shutdown
int shutdown()
Shut down socket.
Definition: JSocket.hh:94
JLANG::JFile::JFile
JFile()
Default constructor.
Definition: JFile.hh:35
JLANG::JFile::fail
virtual bool fail() const
Check status.
Definition: JFile.hh:135
JLANG::JAbstractFile::FILE_CLOSED
static const int FILE_CLOSED
Definition: JAbstractFile.hh:27
IPROTO_TCP
#define IPROTO_TCP
Definition: JSocket.hh:18
JLANG::JFile::close
void close()
Close file.
Definition: JFile.hh:55
JNET::JSocket::accept
void accept(const int server)
Accept connection from a server.
Definition: JSocket.hh:372
JLANG::JFileDescriptorMask::in_avail
bool in_avail(JTimeval timeout=JTimeval::min())
Check availability of input.
Definition: JFileDescriptorMask.hh:264
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JNET::JSocketAddress::setIPnumber
void setIPnumber()
Set any IP number.
Definition: JSocketAddress.hh:119
JLANG::JFileDescriptorMask
Auxiliary class for method select.
Definition: JFileDescriptorMask.hh:24
JNET::JSocketAddress::setFamily
void setFamily(const int family)
Set family.
Definition: JSocketAddress.hh:77
JLANG::JAbstractFile::fileDescriptor
int fileDescriptor
Definition: JAbstractFile.hh:91
JNET::JSocketAddress::getIPnumber
int getIPnumber() const
Get IP number.
Definition: JSocketAddress.hh:99
JNET::JSocket::setOption
void setOption(const int level, const int option, const T value)
Set socket option.
Definition: JSocket.hh:428
JNET::JSocket::connect
void connect(const int port)
Connect to port on local host.
Definition: JSocket.hh:384
JLANG::JFile::eof
virtual bool eof() const
Check end of file.
Definition: JFile.hh:157
JSYSTEM::getHostname
std::string getHostname()
Get host name.
Definition: JNetwork.hh:77
JNET::JSocketAddress::setPort
void setPort(const int port)
Set port number.
Definition: JSocketAddress.hh:141
JSYSTEM::getIPnumber
int getIPnumber(const std::string &host_name)
Get IP number.
Definition: JNetwork.hh:117
JLANG::JFile::write
virtual int write(const char *buffer, const int length)
Write data to file.
Definition: JFile.hh:87
JLANG::JFileDescriptorMask::out_avail
bool out_avail(JTimeval timeout=JTimeval::min())
Check availability of output.
Definition: JFileDescriptorMask.hh:278
JLANG::JAbstractFile::is_open
bool is_open() const
Get open status.
Definition: JAbstractFile.hh:84
JLANG::JFile::bad
virtual bool bad() const
Check status.
Definition: JFile.hh:146
JLANG::JFile::result
int result
Definition: JFile.hh:164