low_level_net.c File Reference


Classes

struct  wire_message
 wire message structure that contains length of the message which is sent before the msg itself More...

Functions

buffer_handle initialize_buffer ()
 Initializes buffer with the default size.
void destroy_handle (struct buffer_handle b)
 Frees the buffer.
void update_buffer_size (struct buffer_handle *bh, int new_size)
 Updates buffer size with the max of given size and current size.
int get_message_length (int ret, struct wire_message *wm)
 Retrieves length of wire message.
void * read_wire_message (struct buffer_handle *buff, int fd)
 Reads the msg from socket.
int write_wire_message (int fd, const void *buf, int nLength)
 Writes the msg to the socket.

Variables

int current_size = -1
 initial size

Function Documentation

void destroy_handle ( struct buffer_handle  b  ) 

Frees the buffer.

Parameters:
[in] b buffer

int get_message_length ( int  ret,
struct wire_message wm 
)

Retrieves length of wire message.

Parameters:
[in] ret return value comes from socket communication
[in] wm wire message comes from socket communication
Returns:
message length in success or negative value in failure

struct buffer_handle initialize_buffer (  ) 

Initializes buffer with the default size.

Returns:
buffer_handle buffer

void* read_wire_message ( struct buffer_handle buff,
int  fd 
)

Reads the msg from socket.

Parameters:
[in] buff buffer
[in] fd socket id

void update_buffer_size ( struct buffer_handle bh,
int  new_size 
)

Updates buffer size with the max of given size and current size.

Parameters:
[in] bh buffer
[in] new_size new size of the buffer

int write_wire_message ( int  fd,
const void *  buf,
int  nLength 
)

Writes the msg to the socket.

Parameters:
[in] fd socket id
[in] buf buffer
[in] nLength length of the msg
Returns:
success of write


Variable Documentation

int current_size = -1

initial size


Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7