mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 23:14:20 +08:00
restart if the X server connection was lost; since synergy is likely to be started by xdm or the user's xsession, it's better for synergy to simply terminate when the connection is lost. synergy will still restart due to other errors. also fixed numerous other minor bugs and cleaned some stuff up (like app error codes are now consistent and enumerated in Version.h, for lack of a better place). and boosted version and protocol numbers.
75 lines
1.4 KiB
C++
75 lines
1.4 KiB
C++
#ifndef XSOCKET_H
|
|
#define XSOCKET_H
|
|
|
|
#include "XBase.h"
|
|
#include "CString.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 {
|
|
public:
|
|
XSocketBind() { }
|
|
XSocketBind(int e) : XSocketErrno(e) { }
|
|
|
|
protected:
|
|
// XBase overrides
|
|
virtual CString getWhat() const throw();
|
|
};
|
|
|
|
class XSocketAddressInUse : public XSocketBind {
|
|
public:
|
|
XSocketAddressInUse() { }
|
|
XSocketAddressInUse(int e) : XSocketBind(e) { }
|
|
};
|
|
|
|
class XSocketConnect : public XSocketErrno {
|
|
public:
|
|
XSocketConnect() { }
|
|
XSocketConnect(int e) : XSocketErrno(e) { }
|
|
|
|
protected:
|
|
// XBase overrides
|
|
virtual CString getWhat() const throw();
|
|
};
|
|
|
|
class XSocketCreate : public XSocketErrno {
|
|
public:
|
|
XSocketCreate() { }
|
|
XSocketCreate(int e) : XSocketErrno(e) { }
|
|
|
|
protected:
|
|
// XBase overrides
|
|
virtual CString getWhat() const throw();
|
|
};
|
|
|
|
#endif
|