#include <poll2_socket.h>
|
| Server () |
|
| ~Server () |
|
int | Get () |
|
bool | Init (int port_, int sec_=10, int usec_=0) |
| Initialize the serv object and open a specified port. Returns false if the socket fails to open or the socket fails to bind and returns true otherwise. More...
|
|
int | RecvMessage (char *message_, size_t length_) |
|
int | SendMessage (char *message_, size_t length_) |
|
bool | Select (int &retval) |
|
void | Close () |
| Close the socket. More...
|
|
Definition at line 23 of file poll2_socket.h.
§ Server()
§ ~Server()
§ Close()
§ Get()
§ Init()
bool Server::Init |
( |
int |
port_, |
|
|
int |
sec_ = 10 , |
|
|
int |
usec_ = 0 |
|
) |
| |
Initialize the serv object and open a specified port. Returns false if the socket fails to open or the socket fails to bind and returns true otherwise.
- Parameters
-
[in] | port_ | The port number to use for the connection. |
[in] | sec_ | The number of seconds to wait for recieve timeout message. |
[in] | usec_ | The number of microseconds in addition to the above seconds to wait for recieve timeout message. |
- Returns
- Returns false if the socket fails to open or bind.
Definition at line 40 of file poll2_socket.cpp.
§ RecvMessage()
int Server::RecvMessage |
( |
char * |
message_, |
|
|
size_t |
length_ |
|
) |
| |
Receive a message from the socket. Returns the number of bytes received. Returns -1 if the receive fails or if the object was not initialized.
Definition at line 63 of file poll2_socket.cpp.
§ Select()
bool Server::Select |
( |
int & |
retval | ) |
|
§ SendMessage()
int Server::SendMessage |
( |
char * |
message_, |
|
|
size_t |
length_ |
|
) |
| |
Send a message to the socket. Returns the number of bytes sent. Returns -1 if the send fails or if the object was not initialized.
Definition at line 73 of file poll2_socket.cpp.
§ from
struct sockaddr_in Server::from |
|
private |
§ fromlen
socklen_t Server::fromlen |
|
private |
§ init
§ length
§ masterfds
§ readfds
§ serv
struct sockaddr_in Server::serv |
|
private |
§ sock
§ timeout
struct timeval Server::timeout |
|
private |
§ to_sec
§ to_usec
The documentation for this class was generated from the following files: