Xojo.Net.HTTPSocket Question

Hey all,

I’m starting to use the Xojo.Net.HTTPSocket and have a question about the error event. The error event is raised by what appears to be an exception inside the socket as the parameter passed into the error event is a runtime exception. This raises a couple questions:

1.) What kind of exceptions get raised here? In the old socket, you’d get error codes for the different errors like Lost Connection or Name Resolution Error, etc. Is there a way to tell which sort of error happened? The documentation is quite scant and there’s nothing about the error event in the example projects.

2.) Do I need to do something with this exception to prevent the program from crashing? How would I do that since the exception is already raised…

I’m moving toward using the Xojo.Net socket as some customers are seeing some exception errors with the old socket and it’s been suspected that it’s because the old socket only support HTTP1.0. It’s odd as when the error occurs is that they are basically reading a 1 line text file from my server. No HTML code or anything. Just a few characters representing a firmware version.

It’s not. We’re moving away from arbitrary error codes to Exceptions in the new framework.

Look at the ErrorCode property of the exception.

Not unless you want to deal with the fact that the socket disconnected for some reason and will not be getting any more events.

[quote=355351:@Greg O’Lone]It’s not. We’re moving away from arbitrary error codes to Exceptions in the new framework.

Look at the ErrorCode property of the exception.
[/quote]

So is the ErrorCode value in the property the exception the same error codes as were generated previously? If not, where do we find out what those codes are? The documentation is scant.

I checked with William and the exception ErrorNumbers are platform-specific and not related to SocketCore.LastErrorCode.

I’ve updated the HTTPSocket page with links to platform-specific error number/code information.

http://developer.xojo.com/xojo-net-httpsocket$Error