summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorBenjamin Scranton <ben@fnwg.org>2014-02-17 13:24:44 -0500
committerBenjamin Scranton <ben@fnwg.org>2014-02-17 13:24:44 -0500
commitafcefc7a0ea6061f993704b556e0ac193fd6d16d (patch)
tree5709eaeda772c79aa1445c16096582d0a2d19668 /platform/windows
parent891b2bdb4f2d1a1a6a1021ae569242fdf184cacc (diff)
windows StreamPeerWinsock::set_nodelay implementation
StreamPeerWinsock::set_nodelay was a no-op. Copied the code from the POSIX implementation because it is also correct on Windows per http://msdn.microsoft.com/en-us/library/windows/desktop/ms740476%28v=vs.85%29.aspx.
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/stream_peer_winsock.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp
index 2c3a8db7b1..eabfb30599 100644
--- a/platform/windows/stream_peer_winsock.cpp
+++ b/platform/windows/stream_peer_winsock.cpp
@@ -337,8 +337,9 @@ Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) {
};
void StreamPeerWinsock::set_nodelay(bool p_enabled) {
-
-
+ ERR_FAIL_COND(!is_connected());
+ int flag=p_enabled?1:0;
+ setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char*)&flag, sizeof(int));
}