Your client uses a fixed thread pool of only 50 threads . But you're trying to create 250 connections. The thread pool can only process 50 connections at a time, but the connection attempts are being made rapidly, potentially overwhelming the server.
Check your operating system's limits:
Various TCP/IP stack settings
Some systems have artificial limits on localhost connections to prevent denial-of-service.