fix networking for both stream and dgram