REBOL Technologies

About the Access Error: Port none not open

Carl Sassenrath, CTO
REBOL Technologies
30-Jul-2008 23:32 GMT

Article #0371
Main page || Index || Prior Article [0370] || Next Article [0372] || Post Comments || Send feedback

Note to end users

If you are an application user seeing this error and not a programmer, contact the organization that wrote your program, and give them the link to this blog.

There is an annoying error message that can occur from time to time:

** Access Error: Port none not open

It happens when your code tries to transfer data to or from a port that is not open.

Here is an example that shows it happening:

>> close a: open tcp://www.rebol.com:80
>> copy a
** Access Error: Port none not open

Unfortunately, the error message is confusing and does not help you debug the problem. In the case above, the problem is obvious, but in many cases, you don't know what port got into trouble.

The "none" part of the error message comes from the port's target field. If there is no target, you see the "none".

If you're having this problem, one way to debug it is to fill in a target name yourself when you open the port. Here's an example:

>> a: open tcp://www.rebol.com:80
>> a/target: a/host
>> close a
>> copy a
** Access Error: Port www.rebol.com not open

Of course, watch out for any code that might access the target field and incorrectly find your contents.

Also, we are experimenting with a change in the next release that builds a better error message:

>> close a: open tcp://www.rebol.com:80
>> copy a
** Access Error: port tcp://www.rebol.com:80 not open

This change would be included in the 2.7.7 release.

Post Comments

Updated 19-Nov-2017   -   Copyright Carl Sassenrath   -   WWW.REBOL.COM   -   Edit   -   Blogger Source Code