ServerSocket and SSLServerSocket

dear all,

i'm trying to change from ServerSocket to SSLServerSocket but i got the error message : 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?
Who is Participating?
Peter KwanConnect With a Mentor Analyst ProgrammerCommented:
SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(port);
ikhmerAuthor Commented:
thank You!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.