Can someone tell me where I find out what the error codes returned from the writeall function are? I'm using it with a socket and I sometimes get negative values (-2 and -3 specifically) returned.
The error codes should be documented in the same doc as the writeall function but they are not as far as I can tell.
Thanks
writeall error codes
Re: writeall error codes
This error changes based on if you are writing to a TCP socket, serial socket, or other. Because -2, or some other value can have different meanings, this is not documented, and you have to follow the source to find it.
What kind of socket are you writing to?
What kind of socket are you writing to?
Forrest Stanley
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
-
- Posts: 19
- Joined: Sat Apr 26, 2008 6:19 am
Re: writeall error codes
I'm writing to a TCP socket serving an HTTP request.
Re: writeall error codes
Here are the TCP err values. Not all of these can come from a write attempt, but all tcp socket errors are defined :>
#define TCP_ERR_NORMAL (0)
#define TCP_ERR_TIMEOUT (-1)
#define TCP_ERR_NOCON (-2)
#define TCP_ERR_CLOSING (-3)
#define TCP_ERR_NOSUCH_SOCKET (-4)
#define TCP_ERR_NONE_AVAIL (-5)
#define TCP_ERR_CON_RESET (-6)
#define TCP_ERR_CON_ABORT (-7)
#define TCP_ERR_NORMAL (0)
#define TCP_ERR_TIMEOUT (-1)
#define TCP_ERR_NOCON (-2)
#define TCP_ERR_CLOSING (-3)
#define TCP_ERR_NOSUCH_SOCKET (-4)
#define TCP_ERR_NONE_AVAIL (-5)
#define TCP_ERR_CON_RESET (-6)
#define TCP_ERR_CON_ABORT (-7)
Forrest Stanley
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
Project Engineer
NetBurner, Inc
NetBurner Learn Articles: http://www.netburner.com/learn
-
- Posts: 19
- Joined: Sat Apr 26, 2008 6:19 am
Re: writeall error codes
Thanks that is what I wanted