(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/net/socket/server#start-socket-server!__%
    (lambda (_impl457_)
      (let ((_$e459_ (std/net/socket/base#current-socket-server)))
        (if _$e459_
            (values _$e459_)
            (begin
              (std/logger#start-logger!__0)
              (let ((_srv462_
                     (gerbil/gambit/threads#spawn/group
                      'socket-server
                      _impl457_)))
                (std/net/socket/base#current-socket-server _srv462_)
                _srv462_))))))
  (define std/net/socket/server#start-socket-server!__0
    (lambda ()
      (let ((_impl468_ (std/net/socket/server#default-server-impl)))
        (std/net/socket/server#start-socket-server!__% _impl468_))))
  (define std/net/socket/server#start-socket-server!
    (lambda _g5532_
      (let ((_g5531_ (let () (declare (not safe)) (##length _g5532_))))
        (cond ((let () (declare (not safe)) (##fx= _g5531_ 0))
               (apply std/net/socket/server#start-socket-server!__0 _g5532_))
              ((let () (declare (not safe)) (##fx= _g5531_ 1))
               (apply std/net/socket/server#start-socket-server!__% _g5532_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/server#start-socket-server!
                _g5532_))))))
  (define std/net/socket/server#stop-socket-server!__%
    (lambda (_srv446_) (std/net/socket/server#server-shutdown! _srv446_)))
  (define std/net/socket/server#stop-socket-server!__0
    (lambda ()
      (let ((_srv452_ (std/net/socket/base#current-socket-server)))
        (std/net/socket/server#server-shutdown! _srv452_))))
  (define std/net/socket/server#stop-socket-server!
    (lambda _g5534_
      (let ((_g5533_ (let () (declare (not safe)) (##length _g5534_))))
        (cond ((let () (declare (not safe)) (##fx= _g5533_ 0))
               (apply std/net/socket/server#stop-socket-server!__0 _g5534_))
              ((let () (declare (not safe)) (##fx= _g5533_ 1))
               (apply std/net/socket/server#server-shutdown! _g5534_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/net/socket/server#stop-socket-server!
                _g5534_))))))
  (define std/net/socket/server#server-shutdown!
    (lambda (_srv434_)
      (let ((_tgroup436_ (thread-thread-group _srv434_)))
        (with-unwind-protect
         (lambda ()
           (let ((_token439_
                  (let ()
                    (declare (not safe))
                    (##structure std/actor/proto#!token::t)))
                 (_dest441_ _srv434_))
             (std/actor/message#send-message__%
              _dest441_
              (let ((__tmp5535
                     (let ()
                       (declare (not safe))
                       (##structure
                        std/net/socket/base#socket-server.shutdown!::t))))
                (declare (not safe))
                (##structure std/actor/proto#!call::t __tmp5535 _token439_))
              '#f
              '#t)
             (std/actor/proto#!!call-recv _token439_ _dest441_))
           (thread-join! _srv434_))
         (lambda () (std/misc/threads#thread-group-kill! _tgroup436_))))))
  (define std/net/socket/server#default-server-impl
    (lambda () std/net/socket/kqueue-server#kqueue-socket-server)))
