cleanup of library docs
This commit is contained in:
parent
e62ef0ff60
commit
eca05d2a33
13 changed files with 216 additions and 114 deletions
|
|
@ -174,7 +174,7 @@ proc acceptRequest(client: TSocket) =
|
|||
executeCgi(client, path, query, meth)
|
||||
|
||||
type
|
||||
TServer* = object
|
||||
TServer* = object ## contains the current server state
|
||||
socket: TSocket
|
||||
port: TPort
|
||||
client*: TSocket ## the socket to write the file data to
|
||||
|
|
@ -187,6 +187,7 @@ proc open*(s: var TServer, port = TPort(0)) =
|
|||
if s.socket == InvalidSocket: OSError()
|
||||
bindAddr(s.socket)
|
||||
listen(s.socket)
|
||||
|
||||
s.port = getSockName(s.socket)
|
||||
s.client = InvalidSocket
|
||||
s.path = ""
|
||||
|
|
@ -215,6 +216,7 @@ proc next*(s: var TServer) =
|
|||
unimplemented(s.client)
|
||||
|
||||
proc close*(s: TServer) =
|
||||
## closes the server (and the socket the server uses).
|
||||
close(s.socket)
|
||||
|
||||
proc run*(handleRequest: proc (client: TSocket, path, query: string): bool,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue