Skip to content

Commit 26c4caf

Browse files
committed
Fix Windows Socket.Send not blocking (case 984723)
This matches behavior of receive variants. Fixes blocking send call where Win32 returns WSAEWOULDBLOCK. Related to issue mono#6464
1 parent acc623a commit 26c4caf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mono/metadata/w32socket-win32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int mono_w32socket_send (SOCKET s, char *buf, int len, int flags, gboolean block
185185
{
186186
int ret = SOCKET_ERROR;
187187
MONO_ENTER_GC_SAFE;
188-
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, send, s, buf, len, flags);
188+
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, TRUE, ret, send, s, buf, len, flags);
189189
MONO_EXIT_GC_SAFE;
190190
return ret;
191191
}
@@ -194,7 +194,7 @@ int mono_w32socket_sendto (SOCKET s, const char *buf, int len, int flags, const
194194
{
195195
int ret = SOCKET_ERROR;
196196
MONO_ENTER_GC_SAFE;
197-
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, sendto, s, buf, len, flags, to, tolen);
197+
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, TRUE, ret, sendto, s, buf, len, flags, to, tolen);
198198
MONO_EXIT_GC_SAFE;
199199
return ret;
200200
}
@@ -203,7 +203,7 @@ int mono_w32socket_sendbuffers (SOCKET s, WSABUF *lpBuffers, guint32 dwBufferCou
203203
{
204204
int ret = SOCKET_ERROR;
205205
MONO_ENTER_GC_SAFE;
206-
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, FALSE, ret, WSASend, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
206+
ALERTABLE_SOCKET_CALL (FD_WRITE_BIT, blocking, TRUE, ret, WSASend, s, lpBuffers, dwBufferCount, lpNumberOfBytesRecvd, lpFlags, lpOverlapped, lpCompletionRoutine);
207207
MONO_EXIT_GC_SAFE;
208208
return ret;
209209
}

0 commit comments

Comments
 (0)