Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


UdpSocket.h

00001 /***************************************************/
00022 /***************************************************/
00023 
00024 #ifndef STK_UDPSOCKET_H
00025 #define STK_UDPSOCKET_H
00026 
00027 #include "Socket.h"
00028 
00029 class UdpSocket : public Socket
00030 {
00031  public:
00033 
00036   UdpSocket( int port = 2006 );
00037 
00039   ~UdpSocket();
00040 
00042 
00045   void setDestination( int port = 2006, std::string hostname = "localhost" );
00046 
00048 
00051   int writeBuffer(const void *buffer, long bufferSize, int flags = 0);
00052 
00054   int readBuffer(void *buffer, long bufferSize, int flags = 0);
00055 
00057   int writeBufferTo(const void *buffer, long bufferSize, int port, std::string hostname = "localhost", int flags = 0 );
00058 
00059  protected:
00060 
00062 
00065   void setAddress( struct sockaddr_in *address, int port = 2006, std::string hostname = "localhost" );
00066 
00067   struct sockaddr_in address_;
00068   bool validAddress_;
00069 
00070 };
00071 
00072 #endif // defined(STK_UDPSOCKET_H)

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