;;; the ip-addresses in sbcl are denoted by vectors not strings.
;;;
http://www.sbcl.org/manual/INET-Domain-Sockets.html#INET-Domain-Sockets
(require :sb-bsd-sockets)
(defparameter *client* nil)
(defvar *client-stream* nil)
(defparameter *sbcl-socket* nil)
(setq *sbcl-socket* (make-instance 'sb-bsd-sockets:inet-socket :type :stream :protocol
:tcp))
;; ip-address is a vector, first the host then the port.
(sb-bsd-sockets:socket-bind *sbcl-socket* #(127 0 0 1) 9997)
(sb-bsd-sockets:socket-listen *sbcl-socket* 5)
(setq *cliente* (sb-bsd-sockets:socket-accept *sbcl-socket*))
;;; to connect to a server use (sb-bsd-sockets:socket-connect ip-vector port)