net/SocketAddress: add CastTo()
This commit is contained in:
committed by
Max Kellermann
parent
32ce9ce919
commit
273771ffec
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2011-2019 Max Kellermann <max.kellermann@gmail.com>
|
||||
* Copyright 2011-2020 Max Kellermann <max.kellermann@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -85,7 +85,7 @@ ToString(SocketAddress address) noexcept
|
||||
#ifdef HAVE_UN
|
||||
if (address.GetFamily() == AF_LOCAL)
|
||||
/* return path of local socket */
|
||||
return LocalAddressToString(*(const sockaddr_un *)address.GetAddress(),
|
||||
return LocalAddressToString(address.CastTo<struct sockaddr_un>(),
|
||||
address.GetSize());
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user