![]() | ![]() | ![]() | start-connection-server | ![]() |
| function port
&key backlog interface name reuse-address | [Function] |
Purpose
Create a connection-server thread that accepts connections
and processes them according to
Package :portable-sockets
Module :portable-sockets
Arguments and values
function | A function designator specifying a function object of one argument | |
port | An integer or a string specifying the service port | |
backlog | An integer (default is 5) | |
interface | A 32-bit internet address or a string specifying a network
interface on the local machine or nil | |
name | A string (default is "Connection Server" | |
reuse-address | A generalized boolean (default is nil )
| |
thread | A thread |
Returns
The new connection-server thread.
Errors
Threads (multiprocessing) is not supported on the
Common Lisp implementation.
Description
The connection server will not accept another
connection until
An interface string can be either a host name, such as
"localhost"
"127.0.0.1"
The value of
See also
kill-thread
open-connection
with-open-connection
Example
Start a simple connection server that accepts connections on port
5555, reads one line of input, and closes the connection:
> (start-connection-server #'(lambda (connection) (let ((line (read-line connection nil))) (format t "~&;; New Connection: ~a~%" line) (close connection))) 5555) #<thread Connection Server>
Note
Use
The GBBopen Project
![]() | ![]() | ![]() | start-connection-server | ![]() |