8000 `wait-for-input` not returning on client disconnection · Issue #44 · usocket/usocket · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
wait-for-input not returning on client disconnection #44
Open
@Zulu-Inuoe

Description

@Zulu-Inuoe

Hello! I noticed that given these functions:

(defun conn-server (&key
                     (interface nil)
                     (port 8080))
  (usocket:with-socket-listener (server interface port)
    (format t "Started server at ~A:~A~%" (usocket:get-local-address server) (usocket:get-local-port server))
    (usocket:with-connected-socket (client (usocket:socket-accept server))
      (format t "Client connected from ~A:~A~%" (usocket:get-peer-address client) (usocket:get-peer-port client))
      (format t "Waiting for input~%")
      (usocket:wait-for-input client))
    (format t "Client disconnected~%")))

(defun conn-client (&key
                      (host "localhost")
                      (port 8080))
  (usocket:with-client-socket (c nil host port)))

If I have a server running, and then call (conn-client), whether from the same process or a remote one, the server enters wait-for-input and never returns.

This may or may not be related to #43 .

This is SBCL 1.4.12 on 64-bit Windows 10.

Additionally, switching from usocket:wait-for-input to an open-stream-p on the socket stream seems to never return nil either.
Maybe I'm doing something logically wrong, but I'd love guidance if that's the case.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0