| CSocket project page | CSocket home page |
00001 /*---------------------------------------------------------------------------*/ 00002 /* */ 00003 /* Socket.h - Passive 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 __PASSIVESOCKET_H__ 00044 #define __PASSIVESOCKET_H__ 00045 #include "ActiveSocket.h" 00046 00055 class CPassiveSocket : public CSimpleSocket { 00056 public: 00057 CPassiveSocket(CSocketType type = SocketTypeTcp); 00058 virtual ~CPassiveSocket() { Close(); }; 00059 00071 virtual CActiveSocket *Accept(void); 00072 00083 bool BindMulticast(const uint8 *pInterface, const uint8 *pGroup, int16 nPort); 00084 00096 virtual bool Listen(const uint8 *pAddr, int16 nPort, int32 nConnectionBacklog = 30000); 00097 00110 virtual int32 Send(const uint8 *pBuf, size_t bytesToSend); 00111 00112 private: 00113 struct ip_mreq m_stMulticastRequest; 00114 00115 }; 00116 00117 #endif // __PASSIVESOCKET_H__
|
hosts this site. |
Send comments to: CarrierLabs Developers |
