MCPcopy Create free account
hub / github.com/cconlon/kerberos-java-gssapi / connectToServer

Method connectToServer

examples/gssClient.java:96–115  ·  view source on GitHub ↗

Connect to example GSS-API server, using specified port and service name.

()

Source from the content-addressed store, hash-verified

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

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected