Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


UdpSocket.h

00001 #ifndef STK_UDPSOCKET_H
00002 #define STK_UDPSOCKET_H
00003 
00004 #include "Socket.h"
00005 
00006 namespace stk {
00007 
00008 /***************************************************/
00029 /***************************************************/
00030 
00031 class UdpSocket : public Socket
00032 {
00033  public:
00035 
00038   UdpSocket( int port = 2006 );
00039 
00041   ~UdpSocket();
00042 
00044 
00047   void setDestination( int port = 2006, std::string hostname = "localhost" );
00048 
00050 
00053   int writeBuffer(const void *buffer, long bufferSize, int flags = 0);
00054 
00056   int readBuffer(void *buffer, long bufferSize, int flags = 0);
00057 
00059   int writeBufferTo(const void *buffer, long bufferSize, int port, std::string hostname = "localhost", int flags = 0 );
00060 
00061  protected:
00062 
00064 
00067   void setAddress( struct sockaddr_in *address, int port = 2006, std::string hostname = "localhost" );
00068 
00069   struct sockaddr_in address_;
00070   bool validAddress_;
00071 
00072 };
00073 
00074 } // stk namespace
00075 
00076 #endif

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