title: How to use usocket to create a connection? (common lisp)
body: <p>I'm trying to use socket in lisp to create a connection. Using sbcl, i found "usocket" available. But I failed to sending strings between the server and client. Here's the code:</p>
  
  <p>Server:</p>
  
  <pre><code>(ql:quickload "usocket")
  (use-package 'usocket)
  (defun default-tcp-handler (stream) ; null
    (declare (type stream stream))
    (terpri stream))
  (defparameter *us* (socket-server "127.0.0.1" 4547 #'default-tcp-handler))
  (defparameter *s* (socket-accept *us*))
  (defparameter *ss* (usocket:socket-stream *s*))
  </code></pre>
  
  <p>Client:</p>
  
  <pre><code>(ql:quickload "usocket")
  (use-package 'usocket)
  (defparameter *us* (socket-connect "127.0.0.1" 4547))
  (defparameter *st* (usocket:socket-stream *us*))
  </code></pre>
  
  <p>I ran the server code first, it freezes. Then I ran the client code. But the server seemed to be no response.
  I tried to format a string into the <em>st</em> stream:</p>
  
  <pre><code>(format *st* "hello, server")
  </code></pre>
  
  <p>But it returns nil.</p>
  
  <p>How can i solve the problem??
  Thanks a lot.</p>