Home Information Classes Download Usage Mail List Requirements Links Tutorial

# Socket.h

    00001 /***************************************************/
    00019 /***************************************************/
    00020
    00021 #if !defined(__SOCKET_H)
    00022 #define __SOCKET_H
    00023
    00024 #include "Stk.h"
    00025
    00026 class Socket : public Stk
    00027 {
    00028  public:
    00030
    00033   Socket( int port = 2006 );
    00034
    00036
    00039   Socket( int port, const char *hostname );
    00040
    00042   ~Socket();
    00043
    00045
    00053   int connect( int port, const char *hostname = "localhost" );
    00054
    00056   void close( void );
    00057
    00059   int socket( void ) const;
    00060
    00062   int port( void ) const;
    00063
    00065
    00071   int accept( void );
    00072
    00074   static void setBlocking( int socket, bool enable );
    00075
    00077   static void close( int socket );
    00078
    00080   static bool isValid( int socket );
    00081
    00083   int writeBuffer(const void *buffer, long bufferSize, int flags = 0);
    00084
    00086   static int writeBuffer(int socket, const void *buffer, long bufferSize, int flags );
    00087
    00089   int readBuffer(void *buffer, long bufferSize, int flags = 0);
    00090
    00092   static int readBuffer(int socket, void *buffer, long bufferSize, int flags );
    00093
    00094  protected:
    00095
    00096   char msg[256];
    00097   int soket;
    00098   int poort;
    00099   bool server;
    00100
    00101 };
    00102
    00103 #endif // defined(__SOCKET_H)

The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.