combinators destructors io.backend io.files.windows io.ports\r
io.sockets io.sockets.icmp io.sockets.private kernel libc math\r
sequences system windows.handles windows.kernel32 windows.types\r
-windows.winsock ;\r
+windows.winsock locals ;\r
FROM: namespaces => get ;\r
IN: io.sockets.windows\r
\r
\r
! http://support.microsoft.com/kb/127144\r
! NOTE: Possibly tweak this because of SYN flood attacks\r
-: listen-backlog ( -- n ) HEX: 7fffffff ; inline\r
+: listen-backlog ( -- n ) 0x7fffffff ; inline\r
\r
M: object (server) ( addrspec -- handle )\r
[\r
\r
:: make-receive-buffer ( n buf -- buf' WSABUF )\r
buf >c-ptr pinned-alien?\r
- [ buf ] [ n malloc [ buf n memcpy ] keep ] if :> buf'\r
+ [ buf ] [ n malloc &free [ buf n memcpy ] keep ] if :> buf'\r
buf'\r
WSABUF malloc-struct &free\r
n >>len\r
\r
:: parse-WSARecvFrom ( buf buf' count wsaRecvFrom -- count sockaddr )\r
buf buf' count finalize-buf\r
- wsaRecvFrom\r
+ count wsaRecvFrom\r
[ port>> addr>> empty-sockaddr dup ]\r
[ lpFrom>> ]\r
[ lpFromLen>> int deref ]\r
tri memcpy ; inline\r
\r
-M: windows (receive) ( n buf datagram -- count addrspec )\r
+M: windows (receive-unsafe) ( n buf datagram -- count addrspec )\r
[\r
<WSARecvFrom-args>\r
[ call-WSARecvFrom ]\r