added support to use socket to determine service from port