Files
barrier/net/XSocket.h
crs 555aa19eb2 added command line and configuration file arguments to choose
the address and port to listen on or connect to.  changed the
default port and put it in ProtocolTypes.h.  the HTTP port is
now no longer opened unless the --http argument is supplied
or the config file includes it.
2002-06-09 16:53:25 +00:00

59 lines
1.1 KiB
C++

#ifndef XSOCKET_H
#define XSOCKET_H
#include "CString.h"
#include "XBase.h"
#include "BasicTypes.h"
class XSocket : public XBase { };
class XSocketAddress : public XSocket {
public:
enum Error { kUnknown, kNotFound, kNoAddress, kBadPort };
XSocketAddress(Error, const CString& hostname, UInt16 port) throw();
// accessors
virtual Error getError() const throw();
virtual CString getHostname() const throw();
virtual UInt16 getPort() const throw();
protected:
// XBase overrides
virtual CString getWhat() const throw();
private:
Error m_error;
CString m_hostname;
UInt16 m_port;
};
class XSocketErrno : public XSocket, public MXErrno {
public:
XSocketErrno();
XSocketErrno(int);
};
class XSocketBind : public XSocketErrno {
protected:
// XBase overrides
virtual CString getWhat() const throw();
};
class XSocketAddressInUse : public XSocketBind { };
class XSocketConnect : public XSocketErrno {
protected:
// XBase overrides
virtual CString getWhat() const throw();
};
class XSocketCreate : public XSocketErrno {
protected:
// XBase overrides
virtual CString getWhat() const throw();
};
#endif