mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-26 21:16:13 +01:00
Added address arg to listen/bind on (sockets)
This commit is contained in:
1 parent
3c70f99028
commit
41fa94478a
6 files changed
+27
-8
No files matched your search
@@ -53,6 +53,10 @@ namespace
|
||||
const sfIpAddress sfIpAddress_None = sfIpAddress_fromBytes(0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfIpAddress sfIpAddress_Any = sfIpAddress_fromBytes(0, 0, 0, 0);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfIpAddress sfIpAddress_LocalHost = sfIpAddress_fromBytes(127, 0, 0, 1);
|
||||
|
||||
|
||||
@@ -67,11 +67,12 @@ unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port)
|
||||
sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port, sfIpAddress address)
|
||||
{
|
||||
CSFML_CHECK_RETURN(listener, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(listener->This.listen(port));
|
||||
sf::IpAddress sfmlAddress(address.address);
|
||||
return static_cast<sfSocketStatus>(listener->This.listen(port, sfmlAddress));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,11 +68,12 @@ unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port)
|
||||
sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port, sfIpAddress address)
|
||||
{
|
||||
CSFML_CHECK_RETURN(socket, sfSocketError);
|
||||
|
||||
return static_cast<sfSocketStatus>(socket->This.bind(port));
|
||||
sf::IpAddress sfmlAddress(address.address);
|
||||
return static_cast<sfSocketStatus>(socket->This.bind(port, sfmlAddress));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user