00001
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __SENT_SPEECH_TCPIP__
00024 #define __SENT_SPEECH_TCPIP__
00025
00026 #include <errno.h>
00027 #if defined(_WIN32) && !defined(__CYGWIN32__)
00028
00029 #include <winsock2.h>
00031 #define WINSOCK
00032 #else
00033
00034 #include <netdb.h>
00035 #include <sys/socket.h>
00036 #include <netinet/in.h>
00037 #include <sys/un.h>
00038 #include <arpa/inet.h>
00039 #include <sys/file.h>
00040 #include <sys/types.h>
00041 #include <fcntl.h>
00042 #endif
00043
00045 #define ADINNET_PORT 5530
00046
00048 #define CONNECTION_RETRY_TIMES 5
00049
00050 #define CONNECTION_RETRY_INTERVAL 2
00051
00052
00053 int rd(int fd, char *data, int *len, int maxlen);
00054 int wt(int fd, char *data, int len);
00055
00056 int ready_as_server(int port_num);
00057 int accept_from(int sd);
00058 int make_connection(char *hostname, int port_num);
00059 int make_connection_unix(char *address);
00060 int close_socket(int sd);
00061 void cleanup_socket();
00062
00063 #endif