Changeset 11033


Ignore:
Timestamp:
Oct 10, 2008, 6:21:35 AM (11 years ago)
Author:
gb
Message:

In the Windows version of SET-SOCKET-FD-BLOCKING: we translate
#$FIONBIO as an unsigned 32-bit constant, but #_ioctlsocket wants
its argumment to be a signed 32-bit value. Treat it as signed, for
now.

In SOCKET-ACCEPT, note that #_accept on Windows will return a handle,
so wrap the local function _ACCEPT's non-negative return value in
a file-descriptor. Things like SLIME crash hard during initialization,
so add some conditional debugging code which prints the PID and waits
for GDB to be attached after a successful accept.

(SLIME seems to crash in a few places; it may have to do with the
fact that the listening socket isn't really capable of I/O, but
the Windows C runtime tries to force output on it (via #_commit)
when the file-descriptor wrapped around it is closed. Or something
like that; I've only been able to catch bits and pieces of whatever's
going on.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-sockets.lisp

    r10877 r11033  
    571571  (let* ((handle (socket-handle fd)))
    572572    (rlet ((argp :u_long (if block-flag 0 1)))
    573       (#_ioctlsocket handle #$FIONBIO argp)))
     573      (#_ioctlsocket handle #.(u32->s32 #$FIONBIO) argp)))
    574574  #-windows-target
    575575  (if block-flag
     
    876876                          (eql res (- #$ENETUNREACH))))
    877877               (- #$EAGAIN)
    878                res))))
     878               #+windows-target (if (< res 0)
     879                                  res
     880                                  (progn
     881                                    ;; SLIME still crashes on startup
     882                                    ;; on (at least) win32.
     883                                    ;; This is intended to make it
     884                                    ;; possible to attach GDB and
     885                                    ;; try to see what's going on.
     886                                    #+debug
     887                                    (format t "~& pid = ~d" (getpid))
     888                                    #+debug
     889                                    (sleep 60)
     890                                    (#__open_osfhandle res 0)))
     891               #-windows-target res))))
    879892    (cond (wait
    880893            (with-eagain fd :input
Note: See TracChangeset for help on using the changeset viewer.