io.sockets.windows: win32-socket instances were not being unregistered from global disposables hash; also check return value of closesocket

db4
Slava Pestov 2010-08-15 00:05:27 -05:00
parent f36d351012
commit cbb9ff61fb
2 changed files with 5 additions and 5 deletions

6
basis/io/backend/windows/windows.factor Normal file → Executable file
View File

@ -30,9 +30,9 @@ TUPLE: win32-file < win32-handle ptr ;
win32-file new-win32-handle ;
M: win32-file dispose
dup disposed>> [ drop ] [
[ cancel-operation ] [ call-next-method ] bi
] if ;
[ dup disposed>> [ drop ] [ cancel-operation ] if ]
[ call-next-method ]
bi ;
HOOK: CreateFile-flags io-backend ( DWORD -- DWORD )
HOOK: FileArgs-overlapped io-backend ( port -- overlapped/f )

4
basis/io/sockets/windows/windows.factor Normal file → Executable file
View File

@ -30,8 +30,8 @@ TUPLE: win32-socket < win32-file ;
: <win32-socket> ( handle -- win32-socket )
win32-socket new-win32-handle ;
M: win32-socket dispose ( stream -- )
handle>> closesocket drop ;
M: win32-socket dispose* ( stream -- )
handle>> closesocket socket-error* ;
: unspecific-sockaddr/size ( addrspec -- sockaddr len )
[ empty-sockaddr/size ] [ protocol-family ] bi pick family<< ;