! Copyright (C) 2007, 2009 Slava Pestov, Doug Coleman.\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: accessors alien alien.c-types alien.data classes.struct\r
-combinators destructors io.backend io.ports io.files.windows\r
-io.sockets io.sockets.private kernel libc math sequences system\r
-windows.handles windows.kernel32 windows.types windows.winsock ;\r
+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
FROM: namespaces => get ;\r
IN: io.sockets.windows\r
\r
dup handle>> listen-backlog listen winsock-return-check\r
] with-destructors ;\r
\r
+GENERIC: windows-socket-type ( obj -- n )\r
+\r
+M: inet4 windows-socket-type drop SOCK_DGRAM ;\r
+\r
+M: inet6 windows-socket-type drop SOCK_DGRAM ;\r
+\r
+M: icmp4 windows-socket-type drop SOCK_RAW ;\r
+\r
+M: icmp6 windows-socket-type drop SOCK_RAW ;\r
+ \r
M: windows (datagram) ( addrspec -- handle )\r
- [ SOCK_DGRAM server-socket ] with-destructors ;\r
+ [ dup windows-socket-type server-socket ] with-destructors ;\r
\r
\r
: malloc-int ( n -- alien )\r