Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-09

Socket error messages

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

How does one convert from the numeric value returned by SocketError to the name of the error (specifically, to e.g. EsockEINVAL rather than EsysEINVAL, i.e. to be in line with the definition of functions like fpbind)?

I notice that the example for fpconnect at
http://lazarus-ccr.sourceforge.net/docs/rtl/sockets/fpconnect.html actually describes a variant of Connect that's not documented for fpconnect.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Van Canneyt
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
How does one convert from the numeric value returned by SocketError to the name of the error (specifically, to e.g. EsockEINVAL rather than EsysEINVAL, i.e. to be in line with the definition of functions like fpbind)?

use the errors unit. (specific for unix)

It has a functiun strerror()

Michael.

Reply by email

Mark Morgan Lloyd
to Mark Morgan Lloyd: How does one convert from the numeric value returned by SocketError to the name of the…
Show quoted text 8 lines
> How does one convert from the numeric value returned by SocketError to > the name of the error (specifically, to e.g. EsockEINVAL rather than > EsysEINVAL, i.e. to be in line with the definition of functions like > fpbind)? use the errors unit. (specific for unix) It has a functiun strerror()

But aren't those EsysEINVAL rather than EsockEINVAL etc.?

> I notice that the example for fpconnect at > http://lazarus-ccr.sourceforge.net/docs/rtl/sockets/fpconnect.html > actually describes a variant of Connect that's not documented for > fpconnect.
Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Michael Van Canneyt
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 10 lines
>> How does one convert from the numeric value returned by SocketError to the >> name of the error (specifically, to e.g. EsockEINVAL rather than >> EsysEINVAL, i.e. to be in line with the definition of functions like >> fpbind)? > use the errors unit. (specific for unix) > > It has a functiun strerror() But aren't those EsysEINVAL rather than EsockEINVAL etc.?

They are the same values. Sockets existed before the unix unit. All these values are simply the POSIX error codes. (some special cases notwithstanding)

Michael.

Reply by email