11
11
// - the copyright holder be liable for any direct, indirect, incidental or -
12
12
// - special damages arising in any way out of the use of this software. -
13
13
// ---------------------------------------------------------------------------
14
// - copyright (c) 1999-2007 amaury darsch -
14
// - copyright (c) 1999-2011 amaury darsch -
15
15
// ---------------------------------------------------------------------------
17
17
#ifndef AFNIX_TCPSOCKET_HPP
46
46
/// @return the class name
47
47
String repr (void) const;
49
/// @return true if we are at the eos
50
bool iseos (void) const;
52
/// check if we can read one character
53
bool valid (void) const;
49
55
/// @return the next available character
58
/// copy the tcp socket into a buffer
59
/// @param rbuf the reference buffer
60
/// @param size the buffer size
61
long copy (char* rbuf, const long size);
52
63
/// write one character on the socket.
53
64
/// @param value the character to write
54
void write (const char value);
65
long write (const char value);
56
67
/// write a character string to the socket
57
/// @param value the character string to write
58
void write (const char* value);
68
/// @param data the data to write
69
long write (const char* data);
60
/// @return true if we are at the eof
61
bool iseof (void) const;
63
/// check if we can read one character
64
/// @param tout the timeout value
65
bool valid (const long tout) const;
71
/// write a character array to the socket
72
/// @param rbuf the reference buffer to write
73
/// @param size the number of character to write
74
long write (const char* rbuf, const long size);
67
76
/// create a new socket by address familly
68
77
/// @param addr the reference address