重新设置代码格式
This commit is contained in:
+12
-10
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "global.h"
|
||||
#include "Socket.h"
|
||||
#include "Core/Base/RingBuffer.hpp"
|
||||
#include "Socket.h"
|
||||
#include "global.h"
|
||||
|
||||
#include <system_error>
|
||||
|
||||
@@ -19,20 +19,22 @@ namespace Psc::asio_socket {
|
||||
using ASIO_StreamRingBuffer = PSC_ASIO_STREAM_RING_BUFFER;
|
||||
using ASIO_PacketRingBuffer = PSC_ASIO_PACKET_RING_BUFFER;
|
||||
|
||||
inline Socket_FD socket_id(const void* ptr) {
|
||||
return static_cast<Socket_FD>(reinterpret_cast<std::uintptr_t>(ptr));
|
||||
inline Socket_FD socket_id(const void *ptr) {
|
||||
return static_cast<Socket_FD>(reinterpret_cast<std::uintptr_t>(ptr));
|
||||
}
|
||||
|
||||
inline Sockaddr_In endpoint_to_sockaddr(const asio::ip::tcp::endpoint& endpoint) {
|
||||
return {endpoint.address().to_string(), endpoint.port()};
|
||||
inline Sockaddr_In
|
||||
endpoint_to_sockaddr(const asio::ip::tcp::endpoint &endpoint) {
|
||||
return {endpoint.address().to_string(), endpoint.port()};
|
||||
}
|
||||
|
||||
inline Sockaddr_In endpoint_to_sockaddr(const asio::ip::udp::endpoint& endpoint) {
|
||||
return {endpoint.address().to_string(), endpoint.port()};
|
||||
inline Sockaddr_In
|
||||
endpoint_to_sockaddr(const asio::ip::udp::endpoint &endpoint) {
|
||||
return {endpoint.address().to_string(), endpoint.port()};
|
||||
}
|
||||
|
||||
inline bool would_block(const asio::error_code& ec) {
|
||||
return ec == asio::error::would_block || ec == asio::error::try_again;
|
||||
inline bool would_block(const asio::error_code &ec) {
|
||||
return ec == asio::error::would_block || ec == asio::error::try_again;
|
||||
}
|
||||
|
||||
} // namespace Psc::asio_socket
|
||||
|
||||
Reference in New Issue
Block a user