All pastes #813904 Raw Edit

Stuff

public cpp v1 · immutable
·published 2007-12-12 21:40 UTC
rendered paste body
// TCPSocket.h#include "TCPSocketException.h"#ifndef TCPSOCKET_H#define TCPSOCKET_H#ifdef WIN32#include <winsock2.h>#include <windows.h>#define close(x) closesocket(x)#else#include <sys/select.h>#include <netdb.h>#include <sys/socket.h>#include <arpa/inet.h>#include <unistd.h>#endifclass TCPSocket{	private:		int sock;		struct sockaddr_in sin;		fd_set set;		struct timeval timeout;		public:		TCPSocket();		TCPSocket(char *, int);		~TCPSocket();		bool connect();		void disconnect();		bool send(char *);		int recv(char *, int);		bool readable();};#endif