The tcp package is loaded by
:- use_module(library(tcp)).
This package relies on the flag fileerrors being set, which is the
default. See fileerrors/0 (ref-iou-sfh-sem) and
prolog_flag/3 (ref-lps-ove) for more about this flag. If
fileerrors is not set, the behavior of this package is unpredictable.
While we're on the subject of flags, it is also probably a good idea to
set the flag syntax_errors to error (see ref-ere-err-syn). In
summary, we recommend that the commands
prolog_flag(fileerrors,_,on),
prolog_flag(syntax_errors,_,error)
be issued before connections are established.