diff options
Diffstat (limited to 'src/SFML/Network/Socket.cpp')
-rw-r--r-- | src/SFML/Network/Socket.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/SFML/Network/Socket.cpp b/src/SFML/Network/Socket.cpp index 58ff16a..37e56b3 100644 --- a/src/SFML/Network/Socket.cpp +++ b/src/SFML/Network/Socket.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org) +// Copyright (C) 2007-2016 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. @@ -82,6 +82,13 @@ void Socket::create() if (m_socket == priv::SocketImpl::invalidSocket()) { SocketHandle handle = socket(PF_INET, m_type == Tcp ? SOCK_STREAM : SOCK_DGRAM, 0); + + if (handle == priv::SocketImpl::invalidSocket()) + { + err() << "Failed to create socket" << std::endl; + return; + } + create(handle); } } |