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)
精彩评论