I wrote a simple socket programme, it works fine, but my friend use a port scanning tool, when it scan to the port I am using, it cash with \"java.net.SocketException: Broke
The reason of your problem may be here:
JavaDoc:
The maximum queue length for incoming connection indications (a request to connect) is set to 50. If a connection indication arrives when the queue is full, the connection is refused.
And you should increase "backlog" parameter of your ServerSocket, for example
int backlogSize = 50 ;
providerSocket = new ServerSocket(portNum, backlogSize);