00001 // -*- c++ -*- 00002 //------------------------------------------------------------------------------ 00003 // UDPSocket.h 00004 //------------------------------------------------------------------------------ 00005 // Copyright (c) 1999,2006 by Vladislav Grinchenko 00006 // 00007 // This library is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU Library General Public 00009 // License as published by the Free Software Foundation; either 00010 // version 2 of the License, or (at your option) any later version. 00011 //------------------------------------------------------------------------------ 00012 // Created: 03/22/99 00013 //------------------------------------------------------------------------------ 00014 #ifndef UDP_SOCKET_H 00015 #define UDP_SOCKET_H 00016 00017 #include "assa/Socket.h" 00018 00019 namespace ASSA { 00020 00028 class UDPSocket : public Socket { 00029 public: 00031 UDPSocket () 00032 { 00033 trace("UDPSocket::UDPSocket()"); 00034 } 00035 00039 UDPSocket (const handler_t fd_) 00040 { 00041 trace("UDPSocket::UDPSocket(fd)"); 00042 m_fd = fd_; 00043 } 00044 00046 virtual ~UDPSocket () 00047 { 00048 trace("UDPSocket::~UDPSocket"); 00049 } 00050 00058 bool open (const int domain_); 00059 00063 bool close (); 00064 00071 bool bind (const Address& my_address_); 00072 00074 handler_t getHandler() const { return m_fd; } 00075 00077 const int getDomain() const { return m_type; } 00078 00079 protected: 00081 void setHandler(const int fd_) { m_fd = fd_; } 00082 00084 void setDomain(const int type_) { m_type = type_; } 00085 }; 00086 00087 } // end namespace ASSA 00088 00089 #endif // UDP_SOCKET_H 00090 00091