Added server close and send functionality.