Thank you so much for your answer..
lmoelleb wrote:
The first suspicious thing I see is you call an async method SendMsgAsync() without waiting for it. This means your Main method can execute the code following myprog.sendMsg() before the message is put on the network.
You was right, I was able to make it run by putting a Thread.Sleep(5000) after myprog.sendMsg(),is not optimal but it work for now.
lmoelleb wrote:
You should make your Main async as well and await the async calls - then it will not terminate before completion (and you will also see any errors). You might also when googling find advise to call .Result or .Wait. Those are excellent advise for people who like to debug why there software occasionally hangs after they make a completely unrelated change. Sure you can use them if you know how it really works under the hood - but that is not a good topic for a beginner.
I gonna check this. Thank you so much for your help!