public void ConnectAndListen() { if (!amsSocket.IsConnected) { amsSocket.ConnectedAsync = false; Connect(); amsSocket.Listen(); } }
public async Task ConnectAndListenAsync() { if (!amsSocket.IsConnected) { amsSocket.ConnectedAsync = true; await ConnectAsync(); amsSocket.Listen(); } }