Main Page | Class List | File List | Class Members | File Members

cddb_net.h File Reference

#include <stdarg.h>
#include <cddb/cddb_ni.h>
#include <cddb/cddb_config.h>

Go to the source code of this file.

Defines

#define CDDB_NET_H   1

Functions

char * sock_fgets (char *s, int size, cddb_conn_t *c)
 This function performs the same task as the standard fgets except for the fact that it might time-out if the socket read takes too long.
size_t sock_fwrite (const void *ptr, size_t size, size_t nmemb, cddb_conn_t *c)
 This function performs the same task as the standard fwrite except for the fact that it might time-out if the socket write takes too long.
int sock_fprintf (cddb_conn_t *c, const char *format,...)
 This function performs the same task as the standard fprintf except for the fact that it might time-out if the socket write takes too long.
int sock_vfprintf (cddb_conn_t *c, const char *format, va_list ap)
 This function performs the same task as the standard vfprintf except for the fact that it might time-out if the socket write takes too long.
hostent * timeout_gethostbyname (const char *hostname, int timeout)
 This function performs the same task as the standard gethostbyname except for the fact that it might time-out if the query takes too long.
int timeout_connect (int sockfd, const struct sockaddr *addr, size_t len, int timeout)
 This function performs the same task as the standard connect except for the fact that it might time-out if the connect takes too long.


Define Documentation

#define CDDB_NET_H   1
 


Function Documentation

char* sock_fgets char *  s,
int  size,
cddb_conn_t c
 

This function performs the same task as the standard fgets except for the fact that it might time-out if the socket read takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
s The string buffer.
size Size of the buffer.
c The CDDB connection structure.
Returns:
The string that was read or NULL on error or EOF when no characters were read.

int sock_fprintf cddb_conn_t c,
const char *  format,
  ...
 

This function performs the same task as the standard fprintf except for the fact that it might time-out if the socket write takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
c The CDDB connection structure.
format Pointer to data record.
Returns:
The number of characters written.

size_t sock_fwrite const void *  ptr,
size_t  size,
size_t  nmemb,
cddb_conn_t c
 

This function performs the same task as the standard fwrite except for the fact that it might time-out if the socket write takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
ptr Pointer to data record.
size Size of data record.
nmemb The number of data records to write.
c The CDDB connection structure.
Returns:
The number of records written.

int sock_vfprintf cddb_conn_t c,
const char *  format,
va_list  ap
 

This function performs the same task as the standard vfprintf except for the fact that it might time-out if the socket write takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
c The CDDB connection structure.
format Pointer to data record.
ap Variable argument list.
Returns:
The number of characters written.

int timeout_connect int  sockfd,
const struct sockaddr *  addr,
size_t  len,
int  timeout
 

This function performs the same task as the standard connect except for the fact that it might time-out if the connect takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
sockfd The socket.
addr The address to connect to.
len The size of the address structure.
timeout Number of seconds after which to time out.
Returns:
Zero on success, -1 on failure (errno will be set).

struct hostent* timeout_gethostbyname const char *  hostname,
int  timeout
 

This function performs the same task as the standard gethostbyname except for the fact that it might time-out if the query takes too long.

In case of a time out, errno will be set to ETIMEDOUT.

Parameters:
hostname The hostname that needs to be resolved.
timeout Number of seconds after which to time out.
Returns:
The host entity for given host name or NULL if not found or timed out (errno will be set).


Generated on Sat Oct 16 18:12:36 2004 for libcddb by doxygen 1.3.8