added binary API to StreamPeer, fixes #2863

This commit is contained in:
Juan Linietsky
2015-12-13 12:53:29 -03:00
parent 451b1d9144
commit 95a469ad28
13 changed files with 383 additions and 9 deletions

View File

@ -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 {