]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/sockets/windows/windows.factor
use radix literals
[factor.git] / basis / io / sockets / windows / windows.factor
index ca6333fe025a22ec1650578b1d41ab0fdcde7d9d..39d4310bb24af961a013efd17620e2db10ff43d1 100755 (executable)
@@ -4,7 +4,7 @@ USING: accessors alien alien.c-types alien.data classes.struct
 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
@@ -72,7 +72,7 @@ M: object ((client)) ( addrspec -- handle )
 \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
@@ -213,7 +213,7 @@ TUPLE: WSARecvFrom-args port
 \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
@@ -252,13 +252,13 @@ TUPLE: WSARecvFrom-args port
 \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