gurba-0.40/
gurba-0.40/bin/
gurba-0.40/lib/
gurba-0.40/lib/cmds/guild/fighter/
gurba-0.40/lib/cmds/monster/
gurba-0.40/lib/cmds/race/catfolk/
gurba-0.40/lib/cmds/race/dwarf/
gurba-0.40/lib/cmds/verb/
gurba-0.40/lib/daemons/data/
gurba-0.40/lib/data/boards/
gurba-0.40/lib/data/messages/
gurba-0.40/lib/data/players/
gurba-0.40/lib/design/
gurba-0.40/lib/domains/gurba/
gurba-0.40/lib/domains/gurba/guilds/fighter/
gurba-0.40/lib/domains/gurba/monsters/
gurba-0.40/lib/domains/gurba/objects/armor/
gurba-0.40/lib/domains/gurba/objects/clothing/
gurba-0.40/lib/domains/gurba/objects/weapons/
gurba-0.40/lib/domains/gurba/vendors/
gurba-0.40/lib/kernel/cmds/admin/
gurba-0.40/lib/kernel/daemons/
gurba-0.40/lib/kernel/include/
gurba-0.40/lib/kernel/lib/
gurba-0.40/lib/kernel/net/
gurba-0.40/lib/kernel/sys/
gurba-0.40/lib/logs/
gurba-0.40/lib/pub/
gurba-0.40/lib/std/modules/languages/
gurba-0.40/lib/std/races/
gurba-0.40/lib/std/races/monsters/
gurba-0.40/lib/wiz/fudge/
gurba-0.40/lib/wiz/spud/
gurba-0.40/src/host/beos/
gurba-0.40/src/host/pc/res/
gurba-0.40/src/kfun/
gurba-0.40/src/lpc/
gurba-0.40/src/parser/
gurba-0.40/tmp/
NAME
	open_port - associate an object with an internet port

SYNOPSIS
	void open_port(string protocol, int port)


DESCRIPTION
	Open a port on the host machine and connect it to this object, which
	is then known as a "port object".  The protocol may be any of "tcp",
	"udp", or "telnet".  Port objects behave differently, depending on
	the protocol. The port number may be omitted, in which case a random
        unused port will be selected.

	When a port is first opened, open(int port) is called in its port
	object.  When it is closed for any reason, close() is called in
        its port object.  Destructing a port object will close its port
        first.

	In a telnet or tcp port,
	     connection(string ipnumber, int port)
	will be called whenever a client connects to it.  This function
	should return an object that will then be known as a "user object".

	In an udp port, 
	    receive_datagram(string data, string ipnumber, int port)
	will be called whenever a datagram arrives on its port.	 The
	ipnumber and port will be those of the sender.	UDP port objects
	may also send datagrams.


ERRORS
	An error will result if the object was already has a connection,
	port, or editor associated with it.
	If the number of existing port and connection objects is equal
	to the value of status()[ST_UTABSIZE], calling open_port() results
	in an error.
	If it is immediately apparent that the port cannot be opened,
	an error will be reported.  In such a case, neither open() nor
	close() will be called in the port object.


SEE ALSO
	kfun/ports, kfun/send_datagram, kfun/send_message, kfun/connect