Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void verzendNaarServer() {
- if (!straten.isEmpty()) {
- try {
- kanaal.verzend(new OpenVerbindingBericht(this.getId()));
- System.setProperty("javax.net.ssl.trustStore", "keyFile");
- System.setProperty("javax.net.ssl.trustStorePassword", "123456");
- Socket aftapSocket = new Socket(InetAddress.getLocalHost(), 4466);
- SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
- SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(aftapSocket, "localhost", 4456, true);
- for (String straat : straten) {
- sslsocket.getOutputStream().write(straat.getBytes());
- }
- sslsocket.getOutputStream().flush();
- sslsocket.getOutputStream().close();
- sslsocket.close();
- aftapSocket.getOutputStream().flush();
- aftapSocket.getOutputStream().close();
- aftapSocket.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- straten.clear();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement