 
    
   
Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial
    6 #if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__)) 
    8   #include <sys/socket.h> 
   10   #include <arpa/inet.h> 
   14   #include <netinet/in.h> 
   15   #include <netinet/tcp.h> 
   17 #elif defined(__OS_WINDOWS__) 
   54   static void close( 
int socket );
 
   57   int id( 
void )
 const { 
return soket_; };
 
   60   int port( 
void )
 const { 
return port_; };
 
   63   static bool isValid( 
int socket ) { 
return socket != -1; };
 
   69   virtual int writeBuffer(
const void *buffer, 
long bufferSize, 
int flags = 0) = 0;
 
   72   virtual int readBuffer(
void *buffer, 
long bufferSize, 
int flags = 0) = 0;
 
   75   static int writeBuffer(
int socket, 
const void *buffer, 
long bufferSize, 
int flags );
 
   78   static int readBuffer(
int socket, 
void *buffer, 
long bufferSize, 
int flags );
 
  
STK internet socket abstract base class.
Definition: Socket.h:38
virtual int writeBuffer(const void *buffer, long bufferSize, int flags=0)=0
Write a buffer over the socket connection. Returns the number of bytes written or -1 if an error occu...
static bool isValid(int socket)
Returns true if the socket descriptor is valid.
Definition: Socket.h:63
virtual ~Socket()
Class destructor.
Socket()
Class constructor.
int id(void) const
Return the socket descriptor.
Definition: Socket.h:57
static void setBlocking(int socket, bool enable)
If enable = false, the socket is set to non-blocking mode. When first created, sockets are by default...
static void close(int socket)
Close the socket.
The STK namespace.
Definition: ADSR.h:6
virtual int readBuffer(void *buffer, long bufferSize, int flags=0)=0
Read an input buffer, up to length bufferSize. Returns the number of bytes read or -1 if an error occ...
int port(void) const
Return the socket port number.
Definition: Socket.h:60
STK base class.
Definition: Stk.h:132