Mercurial > pidgin.yaz
comparison libpurple/network.h @ 32676:32b2a17d2f92
Rename purple_network_listen_range_family() to purple_network_listen_range().
author | andrew.victor@mxit.com |
---|---|
date | Sat, 24 Sep 2011 20:48:59 +0000 |
parents | 75d20c9836c1 |
children | d2ef8926b960 |
comparison
equal
deleted
inserted
replaced
32675:75d20c9836c1 | 32676:32b2a17d2f92 |
---|---|
181 * of type PURPLE_INPUT_READ on the fd returned in cb. It will probably call | 181 * of type PURPLE_INPUT_READ on the fd returned in cb. It will probably call |
182 * accept in the watcher callback, and then possibly remove the watcher and close | 182 * accept in the watcher callback, and then possibly remove the watcher and close |
183 * the listening socket, and add a new watcher on the new socket accept | 183 * the listening socket, and add a new watcher on the new socket accept |
184 * returned. | 184 * returned. |
185 * | 185 * |
186 * Libpurple does not currently do any port mapping (stateful firewall hole | |
187 * poking) for IPv6-only listeners (if an IPv6 socket supports v4-mapped | |
188 * addresses, a mapping is done). | |
189 * | |
186 * @param start The port number to bind to, or 0 to pick a random port. | 190 * @param start The port number to bind to, or 0 to pick a random port. |
187 * Users are allowed to override this arg in prefs. | 191 * Users are allowed to override this arg in prefs. |
188 * @param end The highest possible port in the range of ports to listen on, | 192 * @param end The highest possible port in the range of ports to listen on, |
189 * or 0 to pick a random port. Users are allowed to override this | 193 * or 0 to pick a random port. Users are allowed to override this |
190 * arg in prefs. | 194 * arg in prefs. |
191 * @param socket_type The type of socket to open for listening. | |
192 * This will be either SOCK_STREAM for TCP or SOCK_DGRAM for UDP. | |
193 * @param cb The callback to be invoked when the port to listen on is available. | |
194 * The file descriptor of the listening socket will be specified in | |
195 * this callback, or -1 if no socket could be established. | |
196 * @param cb_data extra data to be returned when cb is called | |
197 * | |
198 * @return A pointer to a data structure that can be used to cancel | |
199 * the pending listener, or NULL if unable to obtain a local | |
200 * socket to listen on. | |
201 */ | |
202 PurpleNetworkListenData *purple_network_listen_range(unsigned short start, | |
203 unsigned short end, int socket_type, | |
204 PurpleNetworkListenCallback cb, gpointer cb_data); | |
205 | |
206 /** | |
207 * \copydoc purple_network_listen_range | |
208 * | |
209 * Libpurple does not currently do any port mapping (stateful firewall hole | |
210 * poking) for IPv6-only listeners (if an IPv6 socket supports v4-mapped | |
211 * addresses, a mapping is done). | |
212 * | |
213 * @param socket_family The protocol family of the socket. This should be | 195 * @param socket_family The protocol family of the socket. This should be |
214 * AF_INET for IPv4 or AF_INET6 for IPv6. IPv6 sockets | 196 * AF_INET for IPv4 or AF_INET6 for IPv6. IPv6 sockets |
215 * may or may not be able to accept IPv4 connections | 197 * may or may not be able to accept IPv4 connections |
216 * based on the system configuration (use | 198 * based on the system configuration (use |
217 * purple_socket_speaks_ipv4 to check). If an IPv6 | 199 * purple_socket_speaks_ipv4 to check). If an IPv6 |
218 * socket doesn't accept V4-mapped addresses, you will | 200 * socket doesn't accept V4-mapped addresses, you will |
219 * need a second listener to support both v4 and v6. | 201 * need a second listener to support both v4 and v6. |
220 * @since 2.7.0 | 202 * @param socket_type The type of socket to open for listening. |
221 * @deprecated This function will be renamed to purple_network_listen_range | 203 * This will be either SOCK_STREAM for TCP or SOCK_DGRAM for UDP. |
222 * in 3.0.0. | 204 * @param cb The callback to be invoked when the port to listen on is available. |
223 */ | 205 * The file descriptor of the listening socket will be specified in |
224 PurpleNetworkListenData *purple_network_listen_range_family( | 206 * this callback, or -1 if no socket could be established. |
207 * @param cb_data extra data to be returned when cb is called | |
208 * | |
209 * @return A pointer to a data structure that can be used to cancel | |
210 * the pending listener, or NULL if unable to obtain a local | |
211 * socket to listen on. | |
212 */ | |
213 PurpleNetworkListenData *purple_network_listen_range( | |
225 unsigned short start, unsigned short end, int socket_family, | 214 unsigned short start, unsigned short end, int socket_family, |
226 int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data); | 215 int socket_type, PurpleNetworkListenCallback cb, gpointer cb_data); |
227 | 216 |
228 /** | 217 /** |
229 * This can be used to cancel any in-progress listener connection | 218 * This can be used to cancel any in-progress listener connection |