Class | PolicyServer |
In: |
flashpolicyd.rb
|
Parent: | Object |
Initializes the server
port: | The port to listen on, if the port is < 1024 server must run as roo |
host: | The host to listen on, use 0.0.0.0 for all addresses |
xml: | The XML to serve to clients |
logger: | An instanse of the Ruby Standard Logger class |
timeout: | How long does client have to complete the whole process before the socket closes and the thread terminates |
debug: | Set to true to enable DEBUG level logging from startup |
Prints some basic stats about the server so far, bogus client are ones that timeout or otherwise cause problems
The main logic of client handling, waits for @timeout seconds to receive a null terminated request containing "policy-file-request" and sends back the data, else marks the client as bogus and close the connection.
Any exception caught during this should mark a client as bogus
Starts the main loop of the server and handles connections, logic is more or less: