shutdown/close implemented for clients and servers