socket.h

Go to the documentation of this file.
00001 /*
00002 #########################################################################
00003 #
00004 #  This file is part of trustyRC.
00005 #
00006 #  trustyRC, fully modular IRC robot 
00007 #  Copyright (C) 2006-2008 Nicoleau Fabien 
00008 #
00009 #  trustyRC is free software: you can redistribute it and/or modify
00010 #  it under the terms of the GNU General Public License as published by
00011 #  the Free Software Foundation, either version 3 of the License, or
00012 #  (at your option) any later version.
00013 #
00014 #  trustyRC is distributed in the hope that it will be useful,
00015 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 #  GNU General Public License for more details.
00018 #
00019 #  You should have received a copy of the GNU General Public License
00020 #  along with trustyRC.  If not, see <http://www.gnu.org/licenses/>.
00021 #
00022 #########################################################################
00023 */
00024 
00029 #ifndef SOCKETIRC_H
00030 #define SOCKETIRC_H
00031 
00032 #include <stdio.h>
00033 #include <stdlib.h>
00034 #include <unistd.h>
00035 #include <sys/types.h>
00036 #include <sys/socket.h>
00037 #include <netinet/in.h>
00038 #include <arpa/inet.h>
00039 #include <netdb.h>
00040 #include <errno.h>
00041 #include <string.h>
00042 #include <iostream>
00043 #include <string>
00044 #include "tools.h"
00045 using namespace std ;
00046 
00053 class Socket 
00054 {
00055    public :
00057       Socket();
00059       ~Socket();
00061       bool sendStr(string);
00063       bool closeSock();
00065       bool connectSock(int,string,string);
00067       bool getState();
00069       string receive();
00070    private :
00072       bool state;
00074       int mySock ;
00075 };
00076 
00077 #endif

Generated on Sun Aug 16 15:28:29 2009 for trustyRC by  doxygen 1.5.8