Hi guys,
Testing the PSDK for a project and getting stuck on capturing ConnID… ![]()
Here I open a connection to the TServer and declare a function to capture the Events.
private void btnConnect_Click(object sender, EventArgs e)
{
TServerEndPoint = new Endpoint("TServer", txtServer.Text, int.Parse(txtPort.Text));
tServerProtocol = new TServerProtocol(TServerEndPoint);
tServerProtocol.Received += OnTServerMessageReceived;
try
{
tServerProtocol.Open();
}
catch (Exception ex)
{
writeToLogArea(ex.Message);
}
}
On the Function I do a simple switch:
private void OnTServerMessageReceived(object sender, EventArgs e)
{
MessageEventArgs args = (MessageEventArgs)e;
System.Diagnostics.Debug.WriteLine( args.Message);
writeToLogArea(args.Message.ToString()); //This works by writing output to a log file
switch (args.Message.Id)
{
case EventDialing.MessageId:
ConnectionId vConnID = ((EventDialing)sender).ConnID;
break;
But here it says it can’t convert the TServerProtocol to a EventDialing object…so how can I capture the ConnID or do the proper cast?
Thanks!