barrier/net/XSocket.cpp
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

85 lines
1.2 KiB
C++

#include "XSocket.h"
//
// XSocketAddress
//
XSocketAddress::XSocketAddress(Error error,
const CString& hostname, UInt16 port) throw() :
m_error(error),
m_hostname(hostname),
m_port(port)
{
// do nothing
}
XSocketAddress::Error XSocketAddress::getError() const throw()
{
return m_error;
}
CString XSocketAddress::getHostname() const throw()
{
return m_hostname;
}
UInt16 XSocketAddress::getPort() const throw()
{
return m_port;
}
CString XSocketAddress::getWhat() const throw()
{
return "no address";
/*
return format("XSocketAddress", "no address: %1:%2",
m_hostname.t_str(),
CString::sprintf("%d", m_port).t_str());
*/
}
//
// XSocketErrno
//
XSocketErrno::XSocketErrno() : MXErrno()
{
// do nothing
}
XSocketErrno::XSocketErrno(int err) : MXErrno(err)
{
// do nothing
}
//
// XSocketBind
//
CString XSocketBind::getWhat() const throw()
{
return format("XSocketBind", "cannot bind address");
}
//
// XSocketConnect
//
CString XSocketConnect::getWhat() const throw()
{
return format("XSocketConnect", "cannot connect socket");
}
//
// XSocketCreate
//
CString XSocketCreate::getWhat() const throw()
{
return format("XSocketCreate", "cannot create socket");
}