- Suppports IPv4 and IPv6 task server addresses.
- Cleaned up error message when server is not available.
This commit is contained in:
Paul Beckingham
2012-10-14 02:04:56 -04:00
parent 47d94f370e
commit cda35c03d6
4 changed files with 123 additions and 94 deletions

View File

@@ -38,25 +38,32 @@
class Socket
{
public:
Socket (int, int, int);
Socket ();
Socket (int);
~Socket ();
void connect (const std::string&, const int);
void close ();
void bind (int, int);
// Client
void connect (const std::string&, const std::string&);
// Server
void bind (const std::string&);
void listen (int queue = 5);
int accept ();
void read (std::string&);
void write (const std::string&);
void close ();
void limit (int);
void debug ();
private:
int _port;
int _family;
void* get_in_addr (struct sockaddr*);
private:
int _socket;
bool _debug;
int _limit;
bool _debug;
};
#endif