im-client - ;NOTES: ;Read NOTES in server.scm: ; Notes that...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
;NOTES: ;Read NOTES in server.scm: ; Notes that apply to both server.scm and this file will be kept in ; server.scm. ;All logging messages are followed by the comment LOGGING (load "~cs61a/lib/im-common.scm") (define logging #t) ; set to true to see logging (define socket-to-server #f) ; Socket to server (define port-to-server #f) ; write port to server (define port-from-server #f) ; Read port from server (define clients #f) ; List of known clients ; Your name (can be changed before im-enroll) (define whoiam (string->word (getenv "USER"))) (define (im-enroll server-address port) ;;;Start handshake with server. ; ;Set! global variables. ;Send "hello" message. ;Check for "welcome" response. ;Set! clients variable. ;Send "thanks" command. ;Set thunk for socket. ; (if socket-to-server (error "Already logged in!")) (set! socket-to-server (make-client-socket server-address port)) (set! port-to-server (socket-output socket-to-server)) (set! port-from-server (socket-input socket-to-server)) (format logging "Sending 'hello' request to server.~%") (if (not
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/30/2010 for the course EECS 21281 taught by Professor Harvey during the Spring '10 term at University of California, Berkeley.

Page1 / 3

im-client - ;NOTES: ;Read NOTES in server.scm: ; Notes that...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online