writeall error codes

Discussion to talk about software related topics only.
Post Reply
craiglindley
Posts: 19
Joined: Sat Apr 26, 2008 6:19 am

writeall error codes

Post by craiglindley »

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
User avatar
Forrest
Posts: 286
Joined: Wed Apr 23, 2008 10:05 am

Re: writeall error codes

Post by Forrest »

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?
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
craiglindley
Posts: 19
Joined: Sat Apr 26, 2008 6:19 am

Re: writeall error codes

Post by craiglindley »

I'm writing to a TCP socket serving an HTTP request.
User avatar
Forrest
Posts: 286
Joined: Wed Apr 23, 2008 10:05 am

Re: writeall error codes

Post by Forrest »

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)
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
craiglindley
Posts: 19
Joined: Sat Apr 26, 2008 6:19 am

Re: writeall error codes

Post by craiglindley »

Thanks that is what I wanted
Post Reply