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 NETAUDIO_DEVNAME "localhost:0"
00049
00051 #define CONNECTION_RETRY_TIMES 5
00053 #define CONNECTION_RETRY_INTERVAL 2
00054
00055
00056 int rd(int fd, char *data, int *len, int maxlen);
00057 int wt(int fd, char *data, int len);
00058
00059 int ready_as_server(int port_num);
00060 int accept_from(int sd);
00061 int make_connection(char *hostname, int port_num);
00062 int make_connection_unix(char *address);
00063 int close_socket(int sd);
00064 void cleanup_socket();
00065
00066 #endif