今天想用common lisp 的usocket 给go 的gonet框架发信息。但是我发现建立连接和关闭连接都正常,但是发送的数据gonet好像就压根没接受到。就很奇怪。
(defparameter msg (concatenate `(vector ,(array-element-type cmdidbuf)) cmdidbuf tagbuf (encode codec testbyte)))
(defparameter socket (usocket:socket-connect "127.0.0.1" 8002 :element-type 'character))
(write-sequence msg (usocket:socket-stream socket))
(force-output (usocket:socket-stream socket))
(format (usocket:socket-stream socket) "jellofdsssssfddddddddddddddddddddddddddddddddd")
(force-output (usocket:socket-stream socket))
(usocket:socket-close socket)