Initial commit of files
This commit is contained in:
69
include/libnet++/TcpSocket.h
Normal file
69
include/libnet++/TcpSocket.h
Normal file
@ -0,0 +1,69 @@
|
||||
//
|
||||
// Socket
|
||||
//
|
||||
|
||||
/* prevent multiple inclusions */
|
||||
#ifndef __TcpSocket__
|
||||
#define __TcpSocket__
|
||||
|
||||
/* includes *****************************************************************/
|
||||
|
||||
#include "Socket.h"
|
||||
|
||||
/* defines ******************************************************************/
|
||||
|
||||
/* macros *******************************************************************/
|
||||
|
||||
/* structs & typedefs *******************************************************/
|
||||
|
||||
/* c class definitions ******************************************************/
|
||||
|
||||
class TcpSocket : public Socket {
|
||||
// public data
|
||||
public:
|
||||
|
||||
protected:
|
||||
// socket
|
||||
|
||||
// stats
|
||||
|
||||
// private data
|
||||
private:
|
||||
|
||||
// static data
|
||||
|
||||
// public methods
|
||||
public:
|
||||
// constructors
|
||||
TcpSocket();
|
||||
|
||||
// destructor
|
||||
virtual ~TcpSocket();
|
||||
|
||||
// copy constructor
|
||||
TcpSocket( const TcpSocket &src ) {Copy(src);};
|
||||
const TcpSocket& operator=( const TcpSocket &src ) {this->Copy(src);return *this;};
|
||||
|
||||
// public methods
|
||||
int Client( const char *host, const char *port );
|
||||
int Server( const char *host, const char *port );
|
||||
int Accept( struct sockaddr_storage *sa );
|
||||
int SendStr( const char *str );
|
||||
|
||||
// control
|
||||
int Nagle( int flag ) {return Nagle(m_sock,flag);};
|
||||
|
||||
// status
|
||||
|
||||
// virtual functions
|
||||
|
||||
// exceptions
|
||||
|
||||
// static methods
|
||||
static int Nagle( int sock, int flag );
|
||||
|
||||
// private methods
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user