]> git.tdb.fi Git - libs/net.git/blobdiff - source/streamlistensocket.cpp
Header changes
[libs/net.git] / source / streamlistensocket.cpp
index 12e98b1f6a2d3b9d40fca5f689f74e2af07a7630..ccb683a1a31937b18b46db991aad021ea6b8fec8 100644 (file)
@@ -1,13 +1,6 @@
-/* $Id$
-
-This file is part of libmspnet
-Copyright © 2008, 2011  Mikkosoft Productions, Mikko Rasa
-Distributed under the LGPL
-*/
-
 #include <cerrno>
 #include <msp/core/refptr.h>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include "streamlistensocket.h"
 #include "streamsocket.h"
 
@@ -28,7 +21,7 @@ void StreamListenSocket::listen(const SockAddr &addr, unsigned backlog)
 {
        bind(addr);
 
-       int err=::listen(handle, backlog);
+       int err = ::listen(handle, backlog);
        if(err==-1)
                throw SystemError("Unable to listen", errno);
 
@@ -37,7 +30,7 @@ void StreamListenSocket::listen(const SockAddr &addr, unsigned backlog)
 #endif
        set_events(IO::P_INPUT);
 
-       listening=true;
+       listening = true;
 }
 
 StreamSocket *StreamListenSocket::accept()
@@ -46,10 +39,10 @@ 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);
 }