Made numeric ports work. Added handlers for poll, close events.