mac stop all connections to port code example Example 1: kill port in mac terminal sudo lsof -i :5955 Example 2: release a port in mac sudo lsof -i :<port>