Error processing SSI file
LEADTOOLS Multimedia (Leadtools.MediaStreaming assembly)

Show in webframe

ConnectionTime Property






Retrieves the last time the client established a connection.
Syntax
public double ConnectionTime {get;}
'Declaration
 
Public ReadOnly Property ConnectionTime As Double
'Usage
 
Dim instance As Client
Dim value As Double
 
value = instance.ConnectionTime
public:
property double ConnectionTime {
   double get();
}

Property Value

A double value representing the last time the client established a connection.
Remarks

This double value represents an OLE Automation DateTime, where the integral component is the number of days before or after midnight, 30 December 1899, and the fractional component represents the time on that day divided by 24.

If the method fails, an error is raised. For more information, refer to the Error Codes.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.MediaStreaming

Public _server As Server = Nothing
Public _result As Boolean = False

Public Sub PrintClientsExample()
  Try
     Dim Count As Integer = 0
     Dim 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 Properties
     Dim clients As Clients = _server.GetClients()

     'Get the Application Properties count
     Count = clients.Count

     ' print the clients items to a string

     strClients &= String.Format("--- Clients (count = {0}) ---" & Constants.vbLf + Constants.vbLf, Count.ToString())

     Dim nIndex As Integer = 0
     For Each client As Client In clients
       Dim ip As String
       Dim connections As Integer
       Dim connectiontime As Double

       ' get IP Address
       ip = client.IPAddress

       ' get number of connections
       connections = client.Connections

       ' get connection time
       connectiontime = client.ConnectionTime

       ' convert to local time
       Dim 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 += 1
     Next client

     ' display a message contains the clients information string
     MessageBox.Show(strClients, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information)

     _result = True
  Catch e1 As Exception
     _result = False
  End Try
End Sub
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 Properties
      Clients clients = _server.GetClients();

      //Get the Application Properties count
      Count = clients.Count;

      // print the clients items to a string

      strClients += 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 Address
         ip = client.IPAddress;

         // get number of connections
         connections = client.Connections;

         // get connection time
         connectiontime = client.ConnectionTime;

         // convert to local time
         DateTime 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 string
      MessageBox.Show(strClients, "LEADTOOLS Media Streaming Examples", MessageBoxButtons.OK, MessageBoxIcon.Information);

      _result = true;
   }
   catch (Exception)
   {
      _result = false;
   }
}
Requirements

Target Platforms

See Also

Reference

Client Class
Client Members

Error processing SSI file
Leadtools.MediaStreaming requires a Multimedia or Multimedia Suite license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features