#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_queue * | Accept_Queue_Create (int backlog) |
void | Accept_Queue_Delete (accept_queue *ac) |
queued_conn * | Accept_Queue_Dequeue (accept_queue *ac) |
int | Accept_Queue_Enqueue (accept_queue *ac, int fd, struct sockaddr sa, struct packet *request) |
Definition in file vfer_accept_queue.h.
accept_queue* Accept_Queue_Create | ( | int | backlog | ) |
Creates the accept queue structure and initializes the data members.
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 |
Definition at line 44 of file vfer_accept_queue.c.
void Accept_Queue_Delete | ( | accept_queue * | ac | ) |
Deletes the accept queue structure.
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.
ac | accept queue pointer from which we dequeu |
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
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 |
Definition at line 92 of file vfer_accept_queue.c.