00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _EGG_NET_H_
00023 #define _EGG_NET_H_
00024
00025 typedef struct {
00026 const char *name;
00027 int (*connect)(const char *host, int port);
00028 int (*reconnect)(int idx, const char *host, int port);
00029 } egg_proxy_t;
00030
00031 int egg_net_init(void);
00032 int egg_net_shutdown(void);
00033
00034 int egg_iprintf(int idx, const char *format, ...);
00035 int egg_server(const char *vip, int port, int *real_port);
00036 int egg_client(int idx, const char *host, int port, const char *vip, int vport, int timeout);
00037 int egg_listen(int port, int *real_port);
00038 int egg_connect(const char *host, int port, int timeout);
00039 int egg_reconnect(int idx, const char *host, int port, int timeout);
00040
00041
00042 int egg_proxy_add(egg_proxy_t *proxy);
00043 int egg_proxy_del(egg_proxy_t *proxy);
00044 egg_proxy_t *egg_proxy_lookup(const char *name);
00045 int egg_proxy_set_default(const char *name);
00046 const char *egg_proxy_get_default();
00047
00048 #endif