Connect to example GSS-API server, using specified port and service name.
()
| 94 | * service name. |
| 95 | **/ |
| 96 | public static void connectToServer() { |
| 97 | |
| 98 | try { |
| 99 | clientSocket = new Socket(server, port); |
| 100 | System.out.println("Connected to " + server + " at port " |
| 101 | + port + "\n"); |
| 102 | |
| 103 | /* get input and output streams */ |
| 104 | serverOut = clientSocket.getOutputStream(); |
| 105 | serverIn = clientSocket.getInputStream(); |
| 106 | |
| 107 | } catch (UnknownHostException e) { |
| 108 | System.err.println("Unknown host: " + server); |
| 109 | e.printStackTrace(); |
| 110 | } catch (IOException e) { |
| 111 | System.err.println("I/O error for the connection to " + server); |
| 112 | e.printStackTrace(); |
| 113 | } |
| 114 | |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Set up GSS-API in preparation for context establishment. Creates |