简体   繁体   中英

What is the meaning of a -12 error on a TCP open in Rebol 3

I am using async TCP networking to read the Stack Overflow Chat at a poll frequency of 1 - 2 seconds. Within 35 minutes or earlier, the connection fails like this in Linux

** Access error: cannot open: tcp://chat.stackoverflow.com:80 reason: -12
** Where: open mini-http forever do either either either -apply-
** Near: open port

On windows I get a #9910 error much earlier which may indicate a malformed port object.

Anyone know what the meaning of this error is?

The code is not much different from that posted here except the View components were removed due to a lack of a View for Linux.

While it may be tempting to think that the "-12" somehow corresponds to a POSIX error number (ENOMEM being 12 would be a somewhat fitting candidate), I fear that the "-12" is just a value hard-coded into R3 without a particular meaning. In the TCP port's "actor" code we find the following line:

if (OS_DO_DEVICE(sock, RDC_OPEN)) Trap_Port(RE_CANNOT_OPEN, port, -12);

So a "cannot open" error is caused, when, well, the port cannot be opened. Along is passed the magic number "-12".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM