Attempting a fix to errors with too many sockets open