Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

tcp.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           tcp.h  -  TCP/IP sockets
00003                              -------------------
00004     begin                : Thu Oct 10 2002
00005     copyright            : (C) 2002 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  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" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, tcp.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 
00028 #ifndef __NETCP_H
00029 #define __NETCP_H
00030 
00031 
00032 
00033 #include "base.h"
00034 #include "socket.h"
00035 
00036 #include <string>
00037 
00038 
00045 namespace NeoEngine
00046 {
00047 
00048 
00049 //External classes
00050 class Thread;
00051 
00052 
00053 
00054 
00060 class NEOENGINE_API TCPSocket : public Socket
00061 {
00062     public:
00063 
00065         int                                    m_iSocket;
00066 
00068         Thread                                *m_pkAcceptThread;
00069 
00070 
00071 
00075                                                TCPSocket( SocketCallback *pkCallback = 0 );
00076 
00081                                                TCPSocket( int iSocket, SocketCallback *pkCallback = 0 );
00082 
00085         virtual                               ~TCPSocket();
00086 
00093         virtual bool                           Listen( int iPort, SocketCallback *pkCallback );
00094 
00101         virtual bool                           Connect( const std::string &rstrAddr, int iPort );
00102 
00109         int                                    Read( void *pDst, int iBytes );
00110 
00117         int                                    Write( const void *pSrc, int iBytes );
00118 
00122         virtual int                            GetFD() { return m_iSocket; }
00123 
00128         virtual void                           SetBlocking( bool bBlock = false );
00129 
00135         virtual unsigned int                   Poll( int iTimeout );
00136 };
00137 
00138 
00139 
00140 }; // namespace NeoEngine
00141 
00142 
00143 
00144 #endif

Generated on Wed Jan 21 14:21:07 2004 for NeoEngine by doxygen 1.3.5