PDA

View Full Version : Problem with socket write which string length is more 300.


jmding
04-27-2002, 06:53 AM
I want to upload a image file to server. First, write the http head to server:"POST /servlet/com.arcware.api.ums.SendPhotoMessage?username=d&password=d HTTP/1.0\r\n\
Host: 172.16.75.36\r\n\
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png,*/*\r\n\
Content-type: multipart/form-data;boundary=7415146092711\r\n\
Content-Lenght: 11197\r\n\r\n" ISOCKET_Write is ok.

Then, i write "--7415146092711\r\nContent-Disposition: form-data; name="aaa"\r\n\r\ngggg\r\n" . It is ok, too.

Then, i write "--7415146092711\r\nContent-Disposition: form-data; name="aaa"\r\n\r\ngggg\r\n" . It has a error. The error no is 532.

torija
04-30-2002, 12:10 AM
Error Number 532 equals to 0x200 + 0x14(Decimal 20).

It means AEE_NET_ECONNABORTED(Connection aborted).

Did you write data thru socket step by step?
Or, did you use writeable callback?

If first, I think the reason is that the http connection closed.
Don't write data by writing and writng. Intead of it, write whole data by using writeable callback function.

jmding
07-15-2002, 08:35 PM
Thanks! I got it.