Add direct socket writing for large arrays