NEventSocket
NEventSocket copied to clipboard
socket disconnect
hi: when I use this command"sofia status profile internal reg", socket will be disconnect.
var socket = await InboundSocket.Connect(freeswitchAddr, freeswitchESPort, freeswitchESPassword);
socket .Disposed += socket _Disposed;
socket .SendApi("sofia status profile internal reg") //when run finish this ,socket _Disposed will be trigger.
sorry,my english is not good。…^~^
It's hard to say what is going on without being able to see all of your code, but it's possible the socket is going out of scope and being garbage collected. I am assuming that you are testing inside a console application:
var socket = await InboundSocket.Connect(freeswitchAddr, freeswitchESPort, freeswitchESPassword);
socket.Disposed += socket _Disposed;
var apiResult = await socket .SendApi("sofia status profile internal reg");
Console.WriteLine(apiResult.ToString());
Console.ReadLine(); //block execution