Make isup entirely local

Opens a socket, checks for errors, closes the socket neatly.