我正在重构一个当前使用 XSockets 3.x 的项目,在该项目中,我们使用旧的 ClientGuid 属性跟踪播放会话和客户端之间的映射。
对于 4.0,ClientGuid 的预期替代品是什么?我可以找到 PersistentId 和 ConnectionId 但我不确定要使用哪一个。
这是 3.x 代码中问题的上下文...
public string CreatePlayback( string RecordingID ) {
string PlayID = SMFRecordServer.Instance.Player.Create( RecordingID, null );
XSocketMediaSink clientSink = new XSocketMediaSink( PlayID, this.ClientGuid, this );
lock ( m_tblSessions ){
if ( m_tblSessions.ContainsKey( ClientGuid ) ){
m_tblSessions[ ClientGuid ].Add( PlayID, clientSink );
}else{
m_tblSessions[ ClientGuid ] = new Dictionary<string,XSocketMediaSink>();
m_tblSessions[ ClientGuid ].Add( PlayID, clientSink );
}
}
SMFRecordServer.Instance.Player.AttachPlaySink( PlayID, clientSink );
return PlayID;
}