开发者

How do I reuse a previously-opened port, using SBCL's sockets?

Creating a server-side socket will fail if I'm trying to use the same port I've used before.开发者_StackOverflow中文版 An address-in-use error occurs.

(make-instance 'sb-bsd-sockets:inet-socket :type :stream :protocol :tcp)

How do I stop this from happening?

Hints and code snippets very welcome! (CL newbie here.)

Thanks!


Use the SB-BSD-SOCKETS:SOCKET-REUSE-ADDRESS socket option accessor:

(setf (sb-bsd-sockets:socket-reuse-address socket) t)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜