NAME listen - open a network port and listen for connections SYNOPSIS none listen(num[, obj, protocol]) DESCRIPTION This builtin is only functional if LPMOO has been built with networking support and the mport_listening configuration option is enabled. Otherwise, E_PERM will be returned. An attempt is made to open the TCP network port specified by `num' on the host machine. If successful, connections received on the port will be bound to the object `obj', which must be valid. If not specified, `obj' defaults to #0. If the port could not be opened because it is already open, E_INVARG is returned. If the port could not be opened for other reasons (such as resource limitations on the host machine), E_QUOTA is returned. When a connection is established, obj:do_login_command() will be called for received lines of input, per the normal MOO login mechanism. The port will remain open until it is closed with unlisten(), or until the server is shutdown. If the argument `protocol' is specified, it must be one of the two strings "binary" or "telnet". If not specified, it will default to "binary". Note that if mport_listening is enabled at all, the normal telnet and binary ports will not be opened automatically. Therefore at least one call to listen() is required for the server to accept any connections. For example, from the #0:server_started verb: status = dgd_status(); listen(status[23], #0, "telnet"); listen(status[24], #0, "binary"); is equivalent to running LPMOO without mport_listening enabled. This builtin requires wizard permissions. SEE ALSO open_network_connection, unlisten, dgd_status