Retrieves the number of active connections the client currently has.
public int Connections {get;} Public ReadOnly Property Connections As Integer public:property int Connections {int get();}
An integer value representing the number of active connections.
A client will be deleted if it has not had any active connections for 60 seconds.
If the method fails, an error is raised. For more information, refer to the Error Codes.
using Leadtools;using Leadtools.MediaStreaming;public Server _server = null;public bool _result = false;public void PrintClientsExample(){try{int Count = 0;string strClients = "";// create an instance of the server object_server = new Leadtools.MediaStreaming.Server();// edit network properties, application properties, MIME types, or IP filters here// start the server_server.Start();// make sure that there is some clients connected to the server.// retrieve a copy of the Application PropertiesClients clients = _server.GetClients();//Get the Application Properties countCount = clients.Count;// print the clients items to a stringstrClients += string.Format("--- Clients (count = {0}) ---\n\n", Count.ToString());int nIndex = 0;foreach (Client client in clients){string ip;int connections;double connectiontime;// get IP Addressip = client.IPAddress;// get number of connectionsconnections = client.Connections;// get connection timeconnectiontime = client.ConnectionTime;// convert to local timeDateTime dt = DateTime.FromOADate(connectiontime);DateTime dtLocal = dt.ToLocalTime();string sconnectiontime = dtLocal.ToString("yyyy-MM-dd HH:mm:ss");strClients += string.Format("Client[{0}]: {1}, connections = {2}, connection time = {3}\n", nIndex.ToString(), ip, connections.ToString(), sconnectiontime);nIndex++;}// display a message contains the clients information stringMessageBox.Show(strClients, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);_result = true;}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MediaStreamingPublic _server As Server = NothingPublic _result As Boolean = FalsePublic Sub PrintClientsExample()TryDim Count As Integer = 0Dim strClients As String = ""' create an instance of the server object_server = New Leadtools.MediaStreaming.Server()' edit network properties, application properties, MIME types, or IP filters here' start the server_server.Start()' make sure that there is some clients connected to the server.' retrieve a copy of the Application PropertiesDim clients As Clients = _server.GetClients()'Get the Application Properties countCount = clients.Count' print the clients items to a stringstrClients &= String.Format("--- Clients (count = {0}) ---" & Constants.vbLf + Constants.vbLf, Count.ToString())Dim nIndex As Integer = 0For Each client As Client In clientsDim ip As StringDim connections As IntegerDim connectiontime As Double' get IP Addressip = client.IPAddress' get number of connectionsconnections = client.Connections' get connection timeconnectiontime = client.ConnectionTime' convert to local timeDim dt As DateTime = DateTime.FromOADate(connectiontime)Dim dtLocal As DateTime = dt.ToLocalTime()Dim sconnectiontime As String = dtLocal.ToString("yyyy-MM-dd HH:mm:ss")strClients &= String.Format("Client[{0}]: {1}, connections = {2}, connection time = {3}" & Constants.vbLf, nIndex.ToString(), ip, connections.ToString(), sconnectiontime)nIndex += 1Next client' display a message contains the clients information stringMessageBox.Show(strClients, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)_result = TrueCatch e1 As Exception_result = FalseEnd TryEnd Sub
|
Products |
Support |
Feedback: Connections Property - Leadtools.MediaStreaming |
Introduction |
Help Version 19.0.2017.6.16
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.