sslClient - PrintStream out = new PrintStream(...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*; import javax.swing.*; import javax.net.ssl.*; i public class sslClient { // sslClient constructor public sslClient() { // open SSLSocket connection to server and send login try { // obtain SSLSocketFactory for creating SSLSockets SSLSocketFactory socketFactory = ( SSLSocketFactory ) SSLSocketFactory.getDefault(); // create SSLSocket from factory SSLSocket socket = ( SSLSocket ) socketFactory.createSocket( "localhost", 7070 );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PrintStream out = new PrintStream( socket.getOutputStream() ); out.println("Hello There"); out.close(); socket.close(); } // end try // handle exception communicating with server catch ( IOException ioException ) { ioException.printStackTrace(); } // exit application finally { System.exit( 0 ); } } // end sslClient constructor // execute application public static void main( String args ) { new sslClient(); } }...
View Full Document

This note was uploaded on 07/14/2011 for the course COP 4610L taught by Professor Staff during the Spring '09 term at University of Central Florida.

Ask a homework question - tutors are online