I am doing socket communication through follwing IP address it working but no i want to do communication in ssl mode but how can I change InetAddress serverAddr = Ine
Basically you need to use SSLSocket which is for SSL communication in Java.
When creating the SSLSocket, you first need to configure the trust store which is to verify the server certificate.
Then you need to get the SSLSocket and connect to the server and then start to do handshake with the server.
Once the handshake complete successfully, you can start to exchange application data with server normally like other plain socket connection.
A HTTPS client and HTTPS server demo in Java provides a demo on how to create SSL server and SSL client in Java. It's quite useful.