summaryrefslogtreecommitdiffstats
path: root/modules/websocket/websocket_peer.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-04-10 17:52:10 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-04-12 12:30:51 +0200
commit6b9ec810c6ccf096b0357ebf3f5fe6e3423d290b (patch)
tree4620c4da42243341d0343aa581ccecaf72402d63 /modules/websocket/websocket_peer.cpp
parent23fc8ca223acb7a2150a57280a3ddf9abac575e3 (diff)
downloadredot-engine-6b9ec810c6ccf096b0357ebf3f5fe6e3423d290b.tar.gz
Implement get_peer_[address|port] in ENet/WSServer
Also implement get_connected_host and get_connected_port in WebSocketPeer (not supported in HTML5 due to browser limitation). Add shorthand disconnect_peer(id) for get_peer(id)->close() like in ENet to WebSocketServer.
Diffstat (limited to 'modules/websocket/websocket_peer.cpp')
-rw-r--r--modules/websocket/websocket_peer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/websocket/websocket_peer.cpp b/modules/websocket/websocket_peer.cpp
index 6324047846..61f783e377 100644
--- a/modules/websocket/websocket_peer.cpp
+++ b/modules/websocket/websocket_peer.cpp
@@ -43,6 +43,8 @@ void WebSocketPeer::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_connected_to_host"), &WebSocketPeer::is_connected_to_host);
ClassDB::bind_method(D_METHOD("was_string_packet"), &WebSocketPeer::was_string_packet);
ClassDB::bind_method(D_METHOD("close"), &WebSocketPeer::close);
+ ClassDB::bind_method(D_METHOD("get_connected_host"), &WebSocketPeer::get_connected_host);
+ ClassDB::bind_method(D_METHOD("get_connected_port"), &WebSocketPeer::get_connected_port);
BIND_ENUM_CONSTANT(WRITE_MODE_TEXT);
BIND_ENUM_CONSTANT(WRITE_MODE_BINARY);