Added getLocalPort method.