Main Site Documentation

Socket exception 10040 / 10042


#1

Hey guys,

Really need some guidance, problem after problem. Simple project, taking a picture with camera and trying to upload to web server.

Every single attempt throws a 10040, message too long and no request goes out. Have tried with HttpRequest and tried again tonight with sockets, always getting a 10040.

Tried to change the socket buffer size and it throws a 10042:



Only way I can get it to work is by splitting the byte array into several chunks and sending it over several requests, but that takes wayyyy too long.

Was working with HttpRequest in 4.2, this problem started in 4.3 for me... can't seem to wrap my mind around it.

#2

@ johndgaf - The 10042 error is because that option is not supported in NETMF.

How big is the buffer you are passing to the socket send function?

Can you show a small snippet of how you send the data in chunks that is too slow?

And what board are you using?


#3

I’m using a FEZ Spider.

Trying to pass a camera captured picture, request is somewhere around 230 KB.

I’m just splitting the picture data array into smaller arrays and sending them with a standard POST request to get it to work, but it’s taking about 6 requests per picture to avoid the 10040 exception.

.PictureData), "image/jpeg");
request.ResponseReceived += new HttpRequest.ResponseHandler(request_ResponseReceived);
request.SendRequest();

This was working in 4.2, as soon as I upgraded to 4.3 the exact same code produced the 10040. Basically now I’m just sending that same request multiple times with different post data because I can’t seem to send it all in one request. Trying with sockets was really just a shot in the dark hoping that it would work.


#4

@ johndgaf - We were able to reproduce the 10040 issue and are looking into a fix but do not have anything at this time.


#5

Thanks boss, your help is very much appreciated


#6

Does this also apply to the built-in webserver class and the “responder.Respond(byte[], string)” method?
Because I am running into the same problem here with image data captured by a serial camera L1.


#7

@ johndgaf - Did you ever get the 10040 error resolved? I am getting the same error when I try to post some text data using socket.send(). Using 4.3.4 on a Cerb.


#8

I was able to resolve my socket.send() error socket.exception 10040 by adding the following:



before the _sock.Send();

I don't know how large I can go.  I only needed 1024 bytes.