Page
Library
Module
Module type
Parameter
Class
Class type
Source
Lpd.MakeSourceMake a Line Printer daemon according to the configuration C.
The functions are splitted to offer various points where threads can be launched.
socket ?port () creates a socket for the LPD daemon.
val accept :
?thread:((unit -> unit) -> unit) ->
Unix.file_descr ->
(Unix.sockaddr -> Socket.in_channel -> Socket.out_channel -> unit) ->
'aaccept ?thread socket f listen on socket and, for each authorized connection (see C.authorized_host), runs f addr inchan outchan where addr is the address of the connecting machine and inchan, outchan are buffered communication channels connected to the client. accept never returns normally.
deamon addr inchan outchan will read LPD queries on inchan and send replies on outchan. The particular treatement each query receives is determined by C.queues. addr is the address of the client. This function is typically used as accept (socket()) daemon.