2001-10-06 18:13:28 +04:00
|
|
|
#ifndef ISOCKET_H
|
|
|
|
#define ISOCKET_H
|
|
|
|
|
|
|
|
#include "IInterface.h"
|
|
|
|
#include "BasicTypes.h"
|
|
|
|
#include "XSocket.h"
|
|
|
|
#include "XIO.h"
|
|
|
|
|
|
|
|
class CNetworkAddress;
|
|
|
|
class IInputStream;
|
|
|
|
class IOutputStream;
|
|
|
|
|
|
|
|
class ISocket : public IInterface {
|
2002-04-29 18:40:01 +04:00
|
|
|
public:
|
2001-10-06 18:13:28 +04:00
|
|
|
// manipulators
|
|
|
|
|
|
|
|
// bind the socket to a particular address
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual void bind(const CNetworkAddress&) = 0;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
|
|
|
// connect the socket
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual void connect(const CNetworkAddress&) = 0;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
|
|
|
// close the socket. this will flush the output stream if it
|
|
|
|
// hasn't been closed yet.
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual void close() = 0;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
|
|
|
// get the input and output streams for the socket. closing
|
|
|
|
// these streams closes the appropriate half of the socket.
|
2001-10-14 20:58:01 +04:00
|
|
|
virtual IInputStream* getInputStream() = 0;
|
|
|
|
virtual IOutputStream* getOutputStream() = 0;
|
2001-10-06 18:13:28 +04:00
|
|
|
|
|
|
|
// accessors
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|