Implement the missing functions of the proposed port selection API.

Signed-off-by: Tobias Schlemmer <keinstein@users.sourcforge.net>
Provide a test case that uses virtual ports to test communication with virtual ports.