Skip to content

Process exits without reading anything from chat. #4

Answered by Bukk94
XcomReborn asked this question in Q&A
Discussion options

You must be logged in to vote

Your example seems correct @XcomReborn. The reason why it exits immediately is that listening is non-blocking. You need to run this code as background task and keep your console up and running, or add some blocking calls to avoid application exit.

Try adding infinite loop after await client.ConnectAsync() line. Something like:

while(true) 
{
   await Task.Delay(500);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by XcomReborn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants