我写的代码
//图片名
NSData *nameDate = [@"61DD9人像__昵称__图片名21212122121.jpg\r\n" dataUsingEncoding:kCFStringEncodingUTF8];
[asyncsocket writeData:nameDate withTimeout:-1 tag:0];
//图片长度
uint64_t length =(uint64_t) imageData.length;
length = CFSwapInt64HostToBig(length);
NSData *lengthdata = [NSData dataWithBytes:&length length:8];
[asyncsocket writeData:lengthdata withTimeout:-1 tag:0];
//图片
[asyncsocket writeData:imageData withTimeout:-1 tag:0];