create socket connection, receive input using select