Add possibility to choose the port of the server.

(and change its error handling).