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