#include <cerrno>
#include <msp/core/refptr.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
#include "streamlistensocket.h"
#include "streamsocket.h"
{
bind(addr);
- int err=::listen(handle, backlog);
+ int err = ::listen(handle, backlog);
if(err==-1)
throw SystemError("Unable to listen", errno);
#endif
set_events(IO::P_INPUT);
- listening=true;
+ listening = true;
}
StreamSocket *StreamListenSocket::accept()
throw InvalidState("Socket is not listening");
sockaddr_storage sa;
- socklen_t size=sizeof(sockaddr_storage);
- SocketHandle new_h=::accept(handle, reinterpret_cast<sockaddr *>(&sa), &size);
+ socklen_t size = sizeof(sockaddr_storage);
+ SocketHandle new_h = ::accept(handle, reinterpret_cast<sockaddr *>(&sa), &size);
- RefPtr<SockAddr> paddr=SockAddr::create(sa);
+ RefPtr<SockAddr> paddr = SockAddr::create(sa);
return new StreamSocket(new_h, *paddr);
}