diff options
Diffstat (limited to 'platform/windows/stream_peer_winsock.cpp')
-rw-r--r-- | platform/windows/stream_peer_winsock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index e8245c92e5..5bc3e34107 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -342,6 +342,14 @@ void StreamPeerWinsock::set_nodelay(bool p_enabled) { setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int)); } +int StreamPeerWinsock::get_available_bytes() const { + + unsigned long len; + int ret = ioctlsocket(sockfd,FIONREAD,&len); + ERR_FAIL_COND_V(ret==-1,0) + return len; + +} IP_Address StreamPeerWinsock::get_connected_host() const { |