Merge pull request #7985 from Faless/enet_godot_sock_squash
Update ENet to use Godot sockets.
This commit is contained in:
commit
296ece2c6a
19 changed files with 423 additions and 1199 deletions
|
|
@ -31,6 +31,11 @@
|
|||
|
||||
PacketPeerUDP *(*PacketPeerUDP::_create)() = NULL;
|
||||
|
||||
void PacketPeerUDP::set_blocking_mode(bool p_enable) {
|
||||
|
||||
blocking = p_enable;
|
||||
}
|
||||
|
||||
String PacketPeerUDP::_get_packet_ip() const {
|
||||
|
||||
return get_packet_address();
|
||||
|
|
@ -78,4 +83,6 @@ PacketPeerUDP *PacketPeerUDP::create() {
|
|||
}
|
||||
|
||||
PacketPeerUDP::PacketPeerUDP() {
|
||||
|
||||
blocking = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class PacketPeerUDP : public PacketPeer {
|
|||
GDCLASS(PacketPeerUDP, PacketPeer);
|
||||
|
||||
protected:
|
||||
bool blocking;
|
||||
|
||||
static PacketPeerUDP *(*_create)();
|
||||
static void _bind_methods();
|
||||
|
||||
|
|
@ -44,6 +46,8 @@ protected:
|
|||
Error _set_dest_address(const String &p_address, int p_port);
|
||||
|
||||
public:
|
||||
void set_blocking_mode(bool p_enable);
|
||||
|
||||
virtual Error listen(int p_port, IP_Address p_bind_address = IP_Address("*"), int p_recv_buffer_size = 65536) = 0;
|
||||
virtual void close() = 0;
|
||||
virtual Error wait() = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue