#endif
-
/**
* @brief handle to a socket
*/
struct GNUNET_NETWORK_Handle;
+
/**
* @brief collection of IO descriptors
*/
*/
int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc);
+
/**
* Connect a socket
*
int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc,
int backlog);
+
/**
* How much data is available to be read on this descriptor?
* @param desc socket
GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle
*desc);
+
/**
* Read data from a connected socket (always non-blocking).
* @param desc socket
struct sockaddr *src_addr,
socklen_t * addrlen);
+
/**
* Read data from a connected socket (always non-blocking).
*
ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc,
void *buffer, size_t length);
+
/**
* Check if sockets meet certain conditions
* @param rfds set of sockets to be checked for readability
struct GNUNET_TIME_Relative timeout);
-
/**
* Send data (always non-blocking).
*
const struct sockaddr *dest_addr,
socklen_t dest_len);
+
/**
* Set socket option
+ *
* @param fd socket
* @param level protocol level of the option
* @param option_name option identifier
const void *option_value,
socklen_t option_len);
+
/**
* Shut down socket operations
+ *
* @param desc socket
* @param how type of shutdown
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc,
int how);
+
/**
* Disable the "CORK" feature for communication with the given socket,
* forcing the OS to immediately flush the buffer on transmission
int type,
int protocol);
+
/**
* Reset FD set (clears all file descriptors).
*
*/
void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds);
+
/**
* Add a socket to the FD set
* @param fds fd set
int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds,
const struct GNUNET_NETWORK_Handle *desc);
+
/**
* Add one fd set to another
* @param dst the fd set to add to
void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst,
const struct GNUNET_NETWORK_FDSet *src);
+
/**
* Copy one fd set to another
* @param to destination
*/
int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc);
+
/**
* Copy a native fd set
* @param to destination
void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds,
const struct GNUNET_DISK_FileHandle *h);
+
/**
* Check if a file handle is part of an fd set
* @param fds fd set
const struct GNUNET_DISK_FileHandle
*h);
+
/**
* Checks if two fd sets overlap
* @param fds1 first fd set
int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1,
const struct GNUNET_NETWORK_FDSet *fds2);
+
/**
* Creates an fd set
* @return a new fd set
*/
struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void);
+
/**
* Releases the associated memory of an fd set
* @param fds fd set