00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef IDATASOCKET_H
00016 #define IDATASOCKET_H
00017
00018 #include "ISocket.h"
00019 #include "IStream.h"
00020
00022
00026 class IDataSocket : public ISocket, public IStream {
00027 public:
00028 class CConnectionFailedInfo {
00029 public:
00030
00031 char m_what[1];
00032 };
00033
00035
00036
00038
00044 virtual void connect(const CNetworkAddress&) = 0;
00045
00047
00048
00049
00051
00055 static CEvent::Type getConnectedEvent();
00056
00058
00063 static CEvent::Type getConnectionFailedEvent();
00064
00066
00067
00068
00069
00070
00071
00072 virtual void bind(const CNetworkAddress&) = 0;
00073 virtual void close();
00074 virtual void* getEventTarget() const;
00075
00076
00077 virtual UInt32 read(void* buffer, UInt32 n) = 0;
00078 virtual void write(const void* buffer, UInt32 n) = 0;
00079 virtual void flush() = 0;
00080 virtual void shutdownInput() = 0;
00081 virtual void shutdownOutput() = 0;
00082 virtual bool isReady() const = 0;
00083 virtual UInt32 getSize() const = 0;
00084
00085 private:
00086 static CEvent::Type s_connectedEvent;
00087 static CEvent::Type s_failedEvent;
00088 };
00089
00090 #endif