check port available using socket and netstat