PAASS
Software suite to Acquire and Analyze Data from Pixie16
Client Class Reference

#include <poll2_socket.h>

Public Member Functions

 Client ()
 
 ~Client ()
 
int Get ()
 
bool Init (const char *address_, int port_)
 
int RecvMessage (char *message_, size_t length_)
 
int SendMessage (char *message_, size_t length_)
 
void Close ()
 Close the socket. More...
 

Private Attributes

int sock
 
int n
 
unsigned int length
 
struct sockaddr_in serv from
 
struct hostent * hp
 
bool init
 

Detailed Description

Definition at line 59 of file poll2_socket.h.

Constructor & Destructor Documentation

§ Client()

Client::Client ( )
inline

Definition at line 68 of file poll2_socket.h.

§ ~Client()

Client::~Client ( )
inline

Definition at line 70 of file poll2_socket.h.

Here is the call graph for this function:

Member Function Documentation

§ Close()

void Client::Close ( )

Close the socket.

Definition at line 135 of file poll2_socket.cpp.

Here is the caller graph for this function:

§ Get()

int Client::Get ( )
inline

Definition at line 72 of file poll2_socket.h.

Here is the call graph for this function:

§ Init()

bool Client::Init ( const char *  address_,
int  port_ 
)

Initialize the client object and open a specified address and port. Returns false if the socket fails to open or the address is unresolved and returns true otherwise.

Definition at line 103 of file poll2_socket.cpp.

Here is the caller graph for this function:

§ RecvMessage()

int Client::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 120 of file poll2_socket.cpp.

§ SendMessage()

int Client::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 129 of file poll2_socket.cpp.

Here is the caller graph for this function:

Field Documentation

§ from

struct sockaddr_in serv Client::from
private

Definition at line 63 of file poll2_socket.h.

§ hp

struct hostent* Client::hp
private

Definition at line 64 of file poll2_socket.h.

§ init

bool Client::init
private

Definition at line 65 of file poll2_socket.h.

§ length

unsigned int Client::length
private

Definition at line 62 of file poll2_socket.h.

§ n

int Client::n
private

Definition at line 61 of file poll2_socket.h.

§ sock

int Client::sock
private

Definition at line 61 of file poll2_socket.h.


The documentation for this class was generated from the following files: