Looks like you provide the data length on the packet, and looks like the length is send in an integer, so are you sure there is a 1024 bytes limit? Maybe there is more space available!