Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Oct 16, 2019 10:51 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Suggestion: SocketCore.ExtendedErrorCode
PostPosted: Wed Aug 29, 2012 6:52 am 
Offline
User avatar

Joined: Sat Sep 30, 2006 10:07 pm
Posts: 32
Location: Hertfordshire, England
Would it seem reasonable to extend SocketCore with an ExtendedErrorCode property that allows for meaningful error handling on the part of client code, while retaining 100% backwards compatibility? That is, for LastErrorCode = 102, the following would be found:

SocketCore:
0. Connection closed with FIN/ACK, or Disconnect() called¹

TCPSocket:
1. Connection closed with RST (peer reset)
2. SYN not acknowedged (connection timeout)
3. ACK not returned (write timeout)

SSLSocket:
1024. SSL/TLS protocol not supported

That way, when error 102 occurs, you can state with confidence to the user exactly what happened, instead of having to play guessing games. For some programs it's genuinely useful to get a handle on what's going on (e.g. application layer protocol test programs), and in general it's better to have specific information to hand: everyone knows how terrible MSIE is with not giving even the slightest suggestion as to why a page won't load.

¹ I would prefer that FIN/ACK (remote disconnect) and Disconnect() (local disconnect) be differentiable, but in the interests of ease of programming, having both use code 0 is a simple way to determine whether the connection closed due to a fault at the TCP level (1 <= ExtendedErrorCode < 1024), protocol level (ExtendedErrorCode >= 1024) or due to intentional behaviour (ExtendedErrorCode = 0).

Opinion may vary here as to how best to handle ease of detecting success vs failure, of course – suggestions welcome!


Top
 Profile  
Reply with quote  
 Post subject: Re: Suggestion: SocketCore.ExtendedErrorCode
PostPosted: Sat Oct 27, 2012 3:46 pm 
Offline

Joined: Sat May 26, 2007 11:37 pm
Posts: 52
Location: Tumwater, Wa
what you have suggested is an Awesome Idea!! I personally would vote for something like this, if Realsoftware could implement that feature.

Though, if you look at the OSI 7 layer model, layers 1 - 4 are normally considered to be handled by the network layers, and layers 5-7 are handled by the Application Layers. in short; Each Layer only cares about its self, and to whom is above it and below it. for instance at Layer 2 the Data Link layer does not directly communicate to the Transport Layer (Layer 4) where TCP is.
one of the many responsibilites that Layer 2 handles is error detection, if the Frame Check Sequence (FCS) of the incomming frame does not calculate to be the same value of the transmitting station put in, then the Data-Link layer will drop the frame. Layer 4 is unaware that layer 2 dropped the frame, all layer 4 knows is that it has segments 1,2,4. But 3 is missing, and will ask for the transmitting machine to retransmit.

not to discorage your thought, as that would be a really nice feature. I don't think Realsoftware can peer into the stack and see what happend,

_________________
• program, n.: A magic spell cast over a computer allowing it to turn one's input into error messages.
tr.v. To engage in a pastime similar to banging one's head against a wall, but with fewer opportunities for reward


Top
 Profile  
Reply with quote  
 Post subject: Re: Suggestion: SocketCore.ExtendedErrorCode
PostPosted: Sat Oct 27, 2012 4:58 pm 
Offline
User avatar

Joined: Sat Sep 30, 2006 10:07 pm
Posts: 32
Location: Hertfordshire, England
Oh I wasn't thinking about going that deep.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group