Solved

ServerSocket and SSLServerSocket

Posted on 2006-12-02
2
346 Views
Last Modified: 2006-12-02
dear all,

i'm trying to change from ServerSocket to SSLServerSocket but i got the error message :

 javax.net.ssl.SSLServerSocket is abstract; cannot be instantiated
        SSLServerSocket ss= new SSLServerSocket(port);
                            ^

here is what i want to change :

 ServerSocket ss = new ServerSocket(port);    change to ==>        SSLServerSocket ss= new SSLServerSocket(port);
       
is it possible to change? if can not what is the solution to do this work?
0
Comment
Question by:ikhmer
2 Comments
 
LVL 16

Accepted Solution

by:
Peter Kwan earned 500 total points
ID: 18059228
SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(port);
0
 

Author Comment

by:ikhmer
ID: 18059368
thank You!!!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question