| CSocket project page | CSocket home page |
00001 /*---------------------------------------------------------------------------*/ 00002 /* */ 00003 /* ActiveSocket.h - Active Socket Decleration */ 00004 /* */ 00005 /* Author : Mark Carrier (mark@carrierlabs.com) */ 00006 /* */ 00007 /*---------------------------------------------------------------------------*/ 00008 /* Copyright (c) 2007-2009 CarrierLabs, LLC. All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without 00011 * modification, are permitted provided that the following conditions 00012 * are met: 00013 * 00014 * 1. Redistributions of source code must retain the above copyright 00015 * notice, this list of conditions and the following disclaimer. 00016 * 00017 * 2. Redistributions in binary form must reproduce the above copyright 00018 * notice, this list of conditions and the following disclaimer in 00019 * the documentation and/or other materials provided with the 00020 * distribution. 00021 * 00022 * 3. The name of the author may not be used to endorse or promote products 00023 * derived from this software without specific prior written permission. 00024 * 00025 * 4. The name "CarrierLabs" must not be used to 00026 * endorse or promote products derived from this software without 00027 * prior written permission. For written permission, please contact 00028 * mark@carrierlabs.com. 00029 * 00030 * THIS SOFTWARE IS PROVIDED BY MARK CARRIER ``AS IS'' AND ANY 00031 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00032 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00033 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARK CARRIER OR 00034 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00035 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00036 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00037 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00038 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00039 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00040 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00041 * OF THE POSSIBILITY OF SUCH DAMAGE. 00042 *----------------------------------------------------------------------------*/ 00043 #ifndef __ACTIVESOCKET_H__ 00044 #define __ACTIVESOCKET_H__ 00045 00046 #include "SimpleSocket.h" 00047 00048 class CPassiveSocket; 00049 00054 class CActiveSocket : public CSimpleSocket { 00055 public: 00056 friend class CPassiveSocket; 00057 00058 CActiveSocket(CSocketType type = SocketTypeTcp); 00059 virtual ~CActiveSocket() { Close(); }; 00060 00069 virtual bool Open(const uint8 *pAddr, int16 nPort); 00070 00071 private: 00074 bool ConnectTCP(const uint8 *pAddr, int16 nPort); 00075 00078 bool ConnectUDP(const uint8 *pAddr, int16 nPort); 00079 00082 bool ConnectRAW(const uint8 *pAddr, int16 nPort); 00083 00084 private: 00085 struct hostent *m_pHE; 00086 }; 00087 00088 #endif /* __ACTIVESOCKET_H__ */ 00089
|
hosts this site. |
Send comments to: CarrierLabs Developers |
