/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef SIRC_BGNET_H
#define SIRC_BGNET_H
#include <stdio.h> // printf(), stderr(), perror()
#include <stdlib.h> // atoi()
#include <unistd.h> // close(), sleep()
#include <errno.h> // errno()
#include <string.h> // memset()
#include <strings.h> // bzero()
#include <sys/socket.h> // socket(), connect(), recv(), send(), AF_INET
#include <sys/types.h> // timeval()
#include <sys/select.h> // select(), FD_SET, FD_ZERO, FD_ISSET
#include <netinet/in.h> // sockaddr(), sockaddr_in(), in_addr()
#include <arpa/inet.h> // htons()
#include <netdb.h> // gethostbyname(), hostent()
class Bgnet
{
public:
int Connect( const char *host, int port );
void Disconnect( int fd );
int SendAll( int fd, const char *data, int data_length );
int Select( int fd );
int Receive( int fd, char *buf, int len );
};
#endif