public void Close() { if (P2P) CommunicationTcp.Close(); else { CommunicationRabbitMqM2S.Close(); CommunicationRabbitMqS2M.Close(); } }