Support client and server mode at same time