scsh-users
[Top] [All Lists]

scsh sockets: help!

To: scsh@martigny.ai.mit.edu
Subject: scsh sockets: help!
From: mwh@gradine.cis.upenn.edu (Michael Hicks)
Date: 11 Apr 1996 17:41:34 GMT
Organization: University of Pennsylvania
I am having trouble getting simple socket stuff to work.  I have a C-based
server that listens on port 6005 for connections and when it receives them,
sends a short text message to the client.  I made a scsh client program:

(define (open-client host port)
  (socket-connect protocol-family/internet socket-type/stream host
          port))

It thinks that it connects, but the server doesn't know anything about it.
I also tried writing a more low level way of doing this (basically the
contents of socket-connect).

Additionally, I tried to write server, with C-clients connecting.  The server:

(define (accept-it sock socket-address)
  (let ((string (list->string
         (map (lambda (x) (ascii->char x))
              '(0 0 0 4 65 65 65 65)))))
    (write-string string (socket:outport sock))))

(define (main args)
  (bind-listen-accept-loop protocol-family/internet accept-it 6005))

This is the tcp version, and I get the error

Error: 122
       "Operation not supported on transport endpoint"
       #{Procedure 9389 %listen}
       3
       5

The UNIX socket version doesn't die immediately, but clients fail to
connect to it.  Could it be my architecture?  My brain?  Help?

Mike

--
Michael Hicks
Ph.D. student, the University of Pennsylvania 
mwh@gradient.cis.upenn.edu
"In studying the way, realizing it is hard; once you have realized it,
preserving it is hard.  When you can preserve it, putting it into practice
is hard."  -- Zen saying

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