#ifndef __TCP_CLIENT__H__
#define __TCP_CLIENT__H__

#include <stdio.h>
#include <netdb.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>	/* set non-blocking I/O */
#include <sys/time.h>
#include <fcntl.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>



/*
 * constant
 */
#define TCP_ERROR	(-1)
#define TCP_NORMAL	0

typedef char	byte;

int tcp_send(int sockfd, byte *send_buffer, int send_buffer_size);
int tcp_recv(int sockfd, byte *recv_buffer, int recv_buffer_size);
int tcp_disconnect(int sockfd);
int tcp_tx_connect(int *sockfd, char *dest_ip, unsigned short int dest_port,int nonblocking_flag);

/////////////////
int tcp_socket(int *sockfd);
int tcp_bind(int sockfd, struct sockaddr *my_addr, int addrlen);
int tcp_listen(int sockfd, int backlog);
int tcp_accept(int sockfd, struct sockaddr *addr,int *addrlen);


#endif /* __TCP_CLIENT__H__ */

