Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

# socket.h

Go to the documentation of this file.

    00001 /*---------------------------------------------------------------------------*/
    00016 /*---------------------------------------------------------------------------*/
    00017
    00018 #ifndef SOCKET_H
    00019 #define SOCKET_H
    00020
    00021 #include <stdio.h>
    00022 #include <strings.h>
    00023
    00024 #include <sys/socket.h>
    00025 #include <sys/types.h>
    00026 #include <resolv.h>
    00027 #include <fcntl.h>
    00028
    00029 #define MAX_CONNECTION                          20
    00030
    00031 int     TCPServerInit( int port, int *serverfd);
    00032 int     TCPServerWaitConnection( int serverfd, int *clientfd, char *clientaddr);
    00033 int     TCPClientInit( int *clientfd);
    00034 int     TCPClientConnect( const int clientfd, const char *addr, int port);
    00035 int     TCPNonBlockRead( int clientfd, char* buf, int size);
    00036 int     TCPBlockRead( int clientfd, char* buf, int size);
    00037 int     TCPWrite( int clientfd, char* buf, int size);
    00038 void    TCPClientClose( int sockfd);
    00039 void    TCPServerClose( int sockfd);
    00040
    00041 #endif