added port and socket support