equal
deleted
inserted
replaced
30 import java.util.LinkedHashSet; |
30 import java.util.LinkedHashSet; |
31 import java.util.List; |
31 import java.util.List; |
32 import java.util.concurrent.CompletableFuture; |
32 import java.util.concurrent.CompletableFuture; |
33 import javax.net.ssl.SSLContext; |
33 import javax.net.ssl.SSLContext; |
34 import javax.net.ServerSocketFactory; |
34 import javax.net.ServerSocketFactory; |
|
35 import javax.net.ssl.SSLException; |
35 import javax.net.ssl.SSLServerSocketFactory; |
36 import javax.net.ssl.SSLServerSocketFactory; |
36 import java.net.http.HttpClient; |
37 import java.net.http.HttpClient; |
37 import java.net.http.HttpClient.Version; |
38 import java.net.http.HttpClient.Version; |
38 import java.net.http.HttpRequest; |
39 import java.net.http.HttpRequest; |
39 import java.net.http.HttpResponse; |
40 import java.net.http.HttpResponse; |
266 out.println("Server: going to send [" + s + "]"); |
267 out.println("Server: going to send [" + s + "]"); |
267 for (int i = 0; i < len; i++) { |
268 for (int i = 0; i < len; i++) { |
268 String onechar = s.substring(i, i + 1); |
269 String onechar = s.substring(i, i + 1); |
269 try { |
270 try { |
270 conn.send(onechar); |
271 conn.send(onechar); |
271 } catch(SocketException x) { |
272 } catch(SocketException | SSLException x) { |
272 if (!useSSL || i != len - 1) throw x; |
273 if (!useSSL || i != len - 1) throw x; |
273 if (x.getMessage().contains("closed by remote host")) { |
274 if (x.getMessage().contains("closed by remote host")) { |
274 String osname = System.getProperty("os.name", "unknown"); |
275 String osname = System.getProperty("os.name", "unknown"); |
275 // On Solaris we can receive an exception when |
276 // On Solaris we can receive an exception when |
276 // the client closes the connection after receiving |
277 // the client closes the connection after receiving |