00001 // -*- C++ -*- 00002 // Definitions for a UNIX Domain Socket connection... 00003 // 00004 // ***** BEGIN LICENSE BLOCK ***** 00005 // Version: MPL 1.1/GPL 2.0/LGPL 2.1 00006 // 00007 // The contents of this file are subject to the Mozilla Public License 00008 // Version 1.1 (the "License"); you may not use this file except in 00009 // compliance with the License. You may obtain a copy of the License at 00010 // http://www.mozilla.org/MPL/ 00011 // 00012 // Software distributed under the License is distributed on an "AS IS" 00013 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00014 // the License for the specific language governing rights and limitations 00015 // under the License. 00016 // 00017 // The Original Code is the consmgr network/serial-line monitoring package. 00018 // 00019 // The Initial Developer of the Original Code is Chris P. Ross. 00020 // Portions created by the Initial Developer are Copyright (C) 2000-2008 00021 // the Initial Developer. All Rights Reserved. 00022 // 00023 // Contributor(s): 00024 // 00025 // Alternatively, the contents of this file may be used under the terms of 00026 // either the GNU General Public License Version 2 or later (the "GPL"), or 00027 // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00028 // in which case the provisions of the GPL or the LGPL are applicable instead 00029 // of those above. If you wish to allow use of your version of this file only 00030 // under the terms of either the GPL or the LGPL, and not to allow others to 00031 // use your version of this file under the terms of the MPL, indicate your 00032 // decision by deleting the provisions above and replace them with the notice 00033 // and other provisions required by the GPL or the LGPL. If you do not delete 00034 // the provisions above, a recipient may use your version of this file under 00035 // the terms of any one of the MPL, the GPL or the LGPL. 00036 // 00037 // ***** END LICENSE BLOCK ***** 00038 00039 #ifndef __UDSLISTENER_H 00040 #define __UDSLISTENER_H 00041 00042 extern "C" { 00043 #include <sys/types.h> 00044 #include <sys/socket.h> 00045 #include <sys/un.h> 00046 } 00047 00048 // Get the base class 00049 #include "socklistener.h" 00050 #include "sockconn.h" 00051 #include "udssockaddr.h" 00052 00056 class UDSListener : public SocketListener { 00057 public: 00058 //UDSListener(UDSSocketAddress &path); 00059 UDSListener(SocketAddressP &path); 00060 ~UDSListener(); 00061 00062 00063 // Return our class name (Should we be able to use RTTI for this?) 00064 std::string class_name() const { return "UDSListener"; } 00065 // Generate an ID string to indicate what we're connected to... 00066 std::string get_id() const; 00067 00068 void disconnect(); 00069 00070 private: 00073 int make_incoming_socket(); 00074 }; 00075 00076 #endif /* __UDSLISTENER_H */