00001 // -*- C++ -*- 00002 // Represents a bidirectional connection to a socket. This is an abstract 00003 // class; you must instantiate an appropriate subclass (currently UDSConn 00004 // or TCPConn). 00005 // 00006 // ***** BEGIN LICENSE BLOCK ***** 00007 // Version: MPL 1.1/GPL 2.0/LGPL 2.1 00008 // 00009 // The contents of this file are subject to the Mozilla Public License 00010 // Version 1.1 (the "License"); you may not use this file except in 00011 // compliance with the License. You may obtain a copy of the License at 00012 // http://www.mozilla.org/MPL/ 00013 // 00014 // Software distributed under the License is distributed on an "AS IS" 00015 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00016 // the License for the specific language governing rights and limitations 00017 // under the License. 00018 // 00019 // The Original Code is the consmgr network/serial-line monitoring package. 00020 // 00021 // The Initial Developer of the Original Code is Chris P. Ross. 00022 // Portions created by the Initial Developer are Copyright (C) 2000-2008 00023 // the Initial Developer. All Rights Reserved. 00024 // 00025 // Contributor(s): 00026 // 00027 // Alternatively, the contents of this file may be used under the terms of 00028 // either the GNU General Public License Version 2 or later (the "GPL"), or 00029 // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00030 // in which case the provisions of the GPL or the LGPL are applicable instead 00031 // of those above. If you wish to allow use of your version of this file only 00032 // under the terms of either the GPL or the LGPL, and not to allow others to 00033 // use your version of this file under the terms of the MPL, indicate your 00034 // decision by deleting the provisions above and replace them with the notice 00035 // and other provisions required by the GPL or the LGPL. If you do not delete 00036 // the provisions above, a recipient may use your version of this file under 00037 // the terms of any one of the MPL, the GPL or the LGPL. 00038 // 00039 // ***** END LICENSE BLOCK ***** 00040 00041 #ifndef __SOCKCONN_H 00042 #define __SOCKCONN_H 00043 00044 extern "C" { 00045 #include <sys/types.h> 00046 #include <netdb.h> 00047 #include <sys/socket.h> 00048 } 00049 00050 // Get the base class 00051 #include "fdconnector.h" 00052 00053 #include "sockaddr.h" 00054 00063 class SocketConnector : public FDConnector { 00064 public: 00068 SocketConnector(SocketAddressP &address); 00069 00071 virtual void connect(); 00072 00074 std::string get_id() const; 00075 00076 protected: 00078 SocketAddressP sock_addr; 00079 }; 00080 00081 #endif /* __SOCKCONN_H */
1.5.5