NEventSocket icon indicating copy to clipboard operation
NEventSocket copied to clipboard

socket disconnect

Open yushu3166 opened this issue 9 years ago • 1 comments

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。…^~^

yushu3166 avatar Sep 14 '16 03:09 yushu3166

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

danbarua avatar Sep 14 '16 09:09 danbarua