
  -spec port_connect(Port, Pid) -> true
                        when Port :: port() | atom(), Pid :: pid().

  Sets the port owner (the connected port) to Pid. Roughly the
  same as Port ! {Owner, {connect, Pid}} except for the following:

   • The error behavior differs, see below.

   • The port does not reply with {Port,connected}.

   • port_connect/1 is synchronous, see below.

   • The new port owner gets linked to the port.

  The old port owner stays linked to the port and must call 
  unlink(Port) if this is not desired. Any process can set the port
  owner to be any process with port_connect/2.

  For comparison: Port ! {self(), {connect, Pid}} only fails with 
  badarg if Port does not refer to a port or a process. If Port
  is a closed port, nothing happens. If Port is an open port and
  the calling process is the port owner, the port replies with 
  {Port, connected} to the old port owner. Notice that the old port
  owner is still linked to the port, while the new is not. If Port
  is an open port and the calling process is not the port owner, the 
  port owner fails with badsig. The port owner fails with badsig
  also if Pid is not an existing local process identifier.

  Notice that any process can set the port owner using Port !
  {PortOwner, {connect, Pid}} as if it itself was the port owner,
  but the reply always goes to the port owner.

  As from Erlang/OTP R16, Port ! {PortOwner, {connect, Pid}} is
  truly asynchronous. Notice that this operation has always been
  documented as an asynchronous operation, while the underlying
  implementation has been synchronous. port_connect/2 is however
  still fully synchronous because of its error behavior.

  Failures:

  badarg:
    If Port is not an identifier of an open port, or the
    registered name of an open port. If the calling process was
    previously linked to the closed port, identified by Port,
    the exit signal from the port is guaranteed to be delivered
    before this badarg exception occurs.

  badarg:
    If the process identified by Pid is not an existing local
    process.
