src/vfer_accept_queue.h File Reference

Header file for accept_queue.c. More...

#include <stdio.h>
#include <pthread.h>
#include "vfer_packet.h"

Go to the source code of this file.

Data Structures

struct  accept_queue
 A doubly linked list of backlogged connections waiting to be accepted. More...
struct  queued_conn
 A queued connection link in the accept_queue doubly linked list. More...

Functions

accept_queueAccept_Queue_Create (int backlog)
void Accept_Queue_Delete (accept_queue *ac)
queued_connAccept_Queue_Dequeue (accept_queue *ac)
int Accept_Queue_Enqueue (accept_queue *ac, int fd, struct sockaddr sa, struct packet *request)


Detailed Description

Header file for accept_queue.c.

Author:
Ivan Beschastnikh
Defines the necessary data structures and prototypes.

Definition in file vfer_accept_queue.h.


Function Documentation

accept_queue* Accept_Queue_Create ( int  backlog  ) 

Creates the accept queue structure and initializes the data members.

Parameters:
backlog the max number of connection to queue in this queue. backlog > 0 right now there is no limit on the size of the backlog
Returns:
pointer to an new accept_queue with backlog max depth on succes NULL on error

Definition at line 44 of file vfer_accept_queue.c.

void Accept_Queue_Delete ( accept_queue ac  ) 

Deletes the accept queue structure.

Parameters:
ac accept_queue pointer

Definition at line 64 of file vfer_accept_queue.c.

queued_conn* Accept_Queue_Dequeue ( accept_queue ac  ) 

Removes and returns a queued connection from the front of the queue.

This function does not block.

Parameters:
ac accept queue pointer from which we dequeu
Returns:
queued connection structure on success (if not empty queue) NULL on error (empty queue or otherwise)

Definition at line 159 of file vfer_accept_queue.c.

int Accept_Queue_Enqueue ( accept_queue ac,
int  fd,
struct sockaddr  sa,
packet request 
)

Adds a queued connection to a queue.

If the queue is full, then we merely wrap around and overwrite old connections

Parameters:
ac accept_queue pointer to which we are trying to enqueue the connection
fd the file descriptor of the open connection
sa the socke address strucutre describing the remote connection
request request packet associated with the new connection
Returns:
0 on succes -1 on error

Definition at line 92 of file vfer_accept_queue.c.


Generated on Tue Aug 8 16:07:20 2006 for VFER by  doxygen 1.4.7