Code for issue #6: Basic connection code: open