scsh-users
[Top] [All Lists]

Problem using sockets

To: scsh-users@scsh.net
Subject: Problem using sockets
From: Emilio Lopes <eclig@gmx.net>
Date: Thu, 17 May 2007 22:18:15 +0200
List-id: <scsh-users.list-id.scsh.net>
Organization: The Church of Emacs
I hope the transcript bellow is enough to describe the problem.
Basically I get an exception when trying to write to a socket.  I'm
pretty sure this used to work, but it doesn't anymore...

I also tried to enable some debugging, but it failed:

   > (socket-option *server-socket* level/socket socket/debug)
   #f
   > (set-socket-option *server-socket* level/socket socket/debug #t)
   Error: 13
          "Permission denied"
          #{Procedure 11768 (%setsockopt in scsh-level-0)}
          9
          1
          1
          1

In case it matters:

   ~% uname -a
   Linux jumeirah 2.6.18-4-k7 #1 SMP Mon Mar 26 17:57:15 UTC 2007 i686 GNU/Linux

Any hint?

   Welcome to scsh 0.6.7 (R6RS)
   Type ,? for help.
   > ,open threads
   > (define (server-start socket socket-addr)
       (format #t "Hello, ~a!\n" (host-info:name (host-info socket-addr)))
       (let ((inport (socket:inport socket))
             (outport (socket:outport socket)))
         (let loop ()
           (let ((input (read-line inport 'trim)))
             (cond
              ((eof-object? input)
               (display "Goodbye.\n" outport)
               (shutdown-socket socket shutdown/sends+receives))
              (else
               (format outport "You said: \"~A\".\n" input)
               (loop)))))))
   > (spawn
      (lambda ()
        (bind-listen-accept-loop protocol-family/internet server-start 6666)))
   > (define *server-socket*
       (socket-connect protocol-family/internet socket-type/stream "localhost" 
6666))
   Hello, jumeirah!
   > (connect-socket-successful? *server-socket*)
   #t
   > (send-message *server-socket* "hi!")

   Error: exception
          gc-protection-mismatch
          (call-external-value "send_substring")
   1> ,debug
   '#{Exception-continuation (pc 3) (call-external-value in scheme-level-0)}

   inspect: d
   '#{Continuation (pc 62) (with-dynamic-env in fluids)}

    [0] '#{Procedure 1109 (unnamed in with-dynamic-env in fluids)}
    [1] '((# . #f) (# # # # # ---) (# . #) (# # # # # ---) (# # # # #) ---)
    [2] #f
    [3] #f
   inspect: q
   '#{Continuation (pc 62) (with-dynamic-env in fluids)}
   1> 

<Prev in Thread] Current Thread [Next in Thread>