tcpsock.h

Go to the documentation of this file.
00001 /*
00002  * tcpsock.h
00003  *
00004  * Transmission Control Protocol socket channel class.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
00025  * All Rights Reserved.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Revision: 20385 $
00030  * $Author: rjongbloed $
00031  * $Date: 2008-06-04 10:40:38 +0000 (Wed, 04 Jun 2008) $
00032  */
00033 
00034 #ifndef _PTCPSOCKET
00035 #define _PTCPSOCKET
00036 
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040 
00041 
00044 class PTCPSocket : public PIPSocket
00045 {
00046   PCLASSINFO(PTCPSocket, PIPSocket);
00047   public:
00057     PTCPSocket(
00058       WORD port = 0             
00059     );
00060     PTCPSocket(
00061       const PString & service   
00062     );
00063     PTCPSocket(
00064       const PString & address,  
00065       WORD port                 
00066     );
00067     PTCPSocket(
00068       const PString & address,  
00069       const PString & service   
00070     );
00071     PTCPSocket(
00072       PSocket & socket          
00073     );
00074     PTCPSocket(
00075       PTCPSocket & tcpSocket    
00076     );
00078 
00093     virtual PObject * Clone() const;
00095 
00112     virtual PBoolean Write(
00113       const void * buf, 
00114       PINDEX len        
00115     );
00117 
00133     virtual PBoolean Listen(
00134       unsigned queueSize = 5,  
00135       WORD port = 0,           
00136       Reusability reuse = AddressIsExclusive 
00137     );
00138     virtual PBoolean Listen(
00139       const Address & bind,     
00140       unsigned queueSize = 5,   
00141       WORD port = 0,            
00142       Reusability reuse = AddressIsExclusive 
00143     );
00144 
00159     virtual PBoolean Accept(
00160       PSocket & socket          
00161     );
00163 
00177     virtual PBoolean WriteOutOfBand(
00178       const void * buf,   
00179       PINDEX len          
00180     );
00181 
00188     virtual void OnOutOfBand(
00189       const void * buf,   
00190       PINDEX len          
00191     );
00193 
00194 
00195   protected:
00196     // Open an IPv4 socket (for backward compatibility)
00197     virtual PBoolean OpenSocket();
00198 
00199     // Open an IPv4 or IPv6 socket
00200     virtual PBoolean OpenSocket(
00201       int ipAdressFamily
00202     );
00203 
00204     virtual const char * GetProtocolName() const;
00205 
00206 
00207 // Include platform dependent part of class
00208 #ifdef _WIN32
00209 #include "msos/ptlib/tcpsock.h"
00210 #else
00211 #include "unix/ptlib/tcpsock.h"
00212 #endif
00213 };
00214 
00215 #endif
00216 
00217 // End Of File ///////////////////////////////////////////////////////////////

Generated on Mon Sep 15 01:21:35 2008 for PTLib by  doxygen 1.5.1