/* [<][>][^][v][top][bottom][index][help] */
/* Definition of server socket class
Rick Smereka, Copyright (C) 2000-2002.
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, get a copy via the Internet at
http://gnu.org/copyleft/gpl.html or write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
You can contact the author via email at rsmereka@future-lab.com
Original version for Unix and Windows 32-bit.
Sep/2000, Rick Smereka
Ported to Debian Linux. Nov/2002, Rick Smereka
Added 'using namespace std'. Dec/2002, Rick Smereka */
#ifndef SSOCKET_HXX
#define SSOCKET_HXX
using namespace std;
class ssocket
{
private:
#ifdef OS_WIN32
SOCKET serverSocket;
SOCKET srvclientSocket;
SOCKADDR_IN sockServerAddr;
SOCKADDR_IN sockClientAddr;
#endif
#ifdef OS_UNIX
int serverSocket;
int srvclientSocket;
struct sockaddr_in sockServerAddr;
struct sockaddr_in sockClientAddr;
#endif
string server_hostname;
int server_port;
bool server_init;
public:
// constructors
ssocket();
ssocket(int port);
// member fuctions
bool init(int port);
bool server_wait(void);
bool is_init(void) { return(server_init); }
bool close_client(void);
bool close_all(void);
int recv_data(string& buf);
int send_data(string& buf);
};
#endif