Connect to server and print a string