some misc functions to handle sockets More...
#include <jabberdlib.h>Functions | |
| int | make_netsocket2 (Glib::ustring servname, Glib::ustring nodename, int type) |
| int | make_netsocket (u_short port, char const *host, int type) |
| struct in_addr * | make_addr (char const *host) |
some misc functions to handle sockets
Hint: after creating a socket with these function, you probably want to register this socket in mio using mio_new().
| struct in_addr* make_addr | ( | char const * | host | ) | [read] |
convert an IPv4 address or hostname to a in_addr structure
| host | the IPv4 address or hostname to convert, on NULL, the hostname is used |
References MAXHOSTNAMELEN.
Referenced by make_netsocket().
| int make_netsocket | ( | u_short | port, | |
| char const * | host, | |||
| int | type | |||
| ) |
Simple wrapper to make socket creation easy.
| port | port number of the socket | |
| host | hostname where to connect to or listen on | |
| type | type of socket (NETSOCKET_SERVER, NETSOCKET_CLIENT; or NETSOCKET_UDP) |
References make_addr(), NETSOCKET_CLIENT, NETSOCKET_SERVER, and NETSOCKET_UDP.
Referenced by make_netsocket2(), and mio_listen().
| int make_netsocket2 | ( | Glib::ustring | servname, | |
| Glib::ustring | nodename, | |||
| int | type | |||
| ) |
Simple wrapper to create sockets
| servname | the service name (currently this has to be a numeric port number) | |
| nodename | the hostname where to connect to or listen on | |
| type | type of socket (NETSOCKET_SERVER, NETSOCKET_CLIENT, or NETSOCKET_UDP) |
References make_netsocket().
1.6.1