(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/net/socket/server#start-socket-server!__%
    (lambda (_impl149558_)
      (let ((_$e149560_ (std/net/socket/base#current-socket-server)))
        (if _$e149560_
            (values _$e149560_)
            (begin
              (std/logger#start-logger!__0)
              (let ((_srv149563_
                     (gerbil/gambit/threads#spawn/group
                      'socket-server
                      _impl149558_)))
                (std/net/socket/base#current-socket-server _srv149563_)
                _srv149563_))))))
  (define std/net/socket/server#start-socket-server!__0
    (lambda ()
      (let ((_impl149569_ (std/net/socket/server#default-server-impl)))
        (std/net/socket/server#start-socket-server!__% _impl149569_))))
  (define std/net/socket/server#start-socket-server!
    (lambda _g149573_
      (let ((_g149572_ (length _g149573_)))
        (cond ((##fx= _g149572_ 0)
               (apply std/net/socket/server#start-socket-server!__0 _g149573_))
              ((##fx= _g149572_ 1)
               (apply std/net/socket/server#start-socket-server!__% _g149573_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/server#start-socket-server!
                _g149573_))))))
  (define std/net/socket/server#stop-socket-server!__%
    (lambda (_srv149547_)
      (std/net/socket/server#server-shutdown! _srv149547_)))
  (define std/net/socket/server#stop-socket-server!__0
    (lambda ()
      (let ((_srv149553_ (std/net/socket/base#current-socket-server)))
        (std/net/socket/server#server-shutdown! _srv149553_))))
  (define std/net/socket/server#stop-socket-server!
    (lambda _g149575_
      (let ((_g149574_ (length _g149575_)))
        (cond ((##fx= _g149574_ 0)
               (apply std/net/socket/server#stop-socket-server!__0 _g149575_))
              ((##fx= _g149574_ 1)
               (apply std/net/socket/server#server-shutdown! _g149575_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/server#stop-socket-server!
                _g149575_))))))
  (define std/net/socket/server#server-shutdown!
    (lambda (_srv149535_)
      (let ((_tgroup149537_ (thread-thread-group _srv149535_)))
        (with-unwind-protect
         (lambda ()
           (let ((_token149540_ (##structure std/actor/proto#!token::t))
                 (_dest149542_ _srv149535_))
             (std/actor/message#send-message__%
              _dest149542_
              (##structure
               std/actor/proto#!call::t
               (##structure std/net/socket/base#socket-server.shutdown!::t)
               _token149540_)
              '#f
              '#t)
             (std/actor/proto#!!call-recv _token149540_ _dest149542_))
           (thread-join! _srv149535_))
         (lambda () (std/misc/threads#thread-group-kill! _tgroup149537_))))))
  (define std/net/socket/server#default-server-impl
    (lambda () std/net/socket/kqueue-server#kqueue-socket-server)))
