1, my server has a ServerSocket to accept client connection
2, my client create a socket and and send message to the server.
3, the server gets the message and reply to the client.
So it’s always the client that initiate the communication.
Say some time later after initial client connection, the server wants to send another message to the client, is it possible to do so?
If you keep the socket connection from the client open on the server yes. The client would need to be always listening for data coming in.
Otherwise the client will have to poll in intervals to the server if the connection on the server is closed after a message is sent.