Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeClientSocket.h

Go to the documentation of this file.
00001 // CascadeClientSocket.h : interface of class CascadeClientSocket
00002 //
00003 // Copyright (c) 2005, Roku, LLC.  All rights reserved.
00004 //
00006 
00007 #ifndef _ROKU_INCLUDE_CASCADE_NET_CASCADECLIENTSOCKET_H
00008 #define _ROKU_INCLUDE_CASCADE_NET_CASCADECLIENTSOCKET_H
00009 
00010 #include <cascade/CascadeObject.h>
00011 
00013 // class CascadeClientSocket - an easy to use socket for client connections
00014 class CascadeClientSocket : public CascadeObject
00015 {
00016 public:
00017     CascadeClientSocket();
00018     virtual ~CascadeClientSocket();
00019 
00020 public:
00021     enum Type  { kDatagram = 0, kStream };
00022     enum Error { kNoError = 0, kTimeout, kInvalidSocket, kSocketError, kOutOfMemory };
00023     enum       { kDefaultTimeoutMS = 5000 };
00024 
00025 public:
00026     bool Open(Type type, const char * pRemoteServer, u16 nRemotePort, u32 nTimeoutMS = kDefaultTimeoutMS);
00027     bool Close();
00028     u32  Send(void * pData, u32 nDataLen, u32 nTimeoutMS = kDefaultTimeoutMS);
00029     bool SendAll(void * pData, u32 nDataLen, u32 nTimeoutMS = kDefaultTimeoutMS);
00030     u32  Receive(void * pDataToSet, u32 nDataLen, u32 nTimeoutMS = kDefaultTimeoutMS);
00031     bool ReceiveAll(void * pDataToSet, u32 nDataLen, u32 nTimeoutMS = kDefaultTimeoutMS);
00032     Error GetLastError();
00033 
00034 private:
00035     class Socket;
00036     Socket * m_pSocket;
00037 };
00038 
00039 #endif // #ifndef _ROKU_INCLUDE_CASCADE_NET_CASCADECLIENTSOCKET_H
00040 
00042 //      LOG 
00044 //  18-May-05   dwoodward   created
00045 

Generated on Sun Jul 24 14:27:17 2005 for Cascade Library by  doxygen 1.4.1