1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "platform/impl/socket_handle_posix.h" 6 7 #include <cstdlib> 8 #include <functional> 9 10 namespace openscreen { 11 SocketHandle(int descriptor)12SocketHandle::SocketHandle(int descriptor) : fd(descriptor) {} 13 operator ==(const SocketHandle & lhs,const SocketHandle & rhs)14bool operator==(const SocketHandle& lhs, const SocketHandle& rhs) { 15 return lhs.fd == rhs.fd; 16 } 17 operator ()(const SocketHandle & handle) const18size_t SocketHandleHash::operator()(const SocketHandle& handle) const { 19 return std::hash<int>()(handle.fd); 20 } 21 22 } // namespace openscreen 23