How would I choose in java that which port is free to use for ServerSocket or Socket?
I'm working on java. How would I check that a port is free to use for a ServerSocket? Moreover when a Socket is returned by the accept() function is it given a port and IP address by default or I would have to specify that too?
Can you answer this question?
Write Answer1 Answers