looking at places that throw EOF it seems you have a low level socket error, unfortunately the actual error code isn't exposed or reported (but that could be patched in a custom version of stdlib or hxcpp). my guess would be either your connection breaks mid-send or your send buffer is full.
try sending less data and see if it still happens, and use traces or wireshark to see if your connection breaks.