added auto port option
fixed variable name
basic example of auto discovery and connection on a locsl network