ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data.Realtime Namespace / RealtimeServiceConnectionProperties Class / RealtimeServiceConnectionProperties Constructor
A valid path to a service URL.
The type of the Realtime Datastore.
Example

In This Topic
    RealtimeServiceConnectionProperties Constructor
    In This Topic
    Initializes a new instance of the RealtimeConnectionProperties class.
    Syntax
    public RealtimeServiceConnectionProperties( 
       Uri serviceURL,
       RealtimeDatastoreType type
    )
    Public Function New( _
       ByVal serviceURL As Uri, _
       ByVal type As RealtimeDatastoreType _
    )

    Parameters

    serviceURL
    A valid path to a service URL.
    type
    The type of the Realtime Datastore.
    Exceptions
    ExceptionDescription
    serviceURL is null.
    Example
    Connect to a real-time feature class from a real-time datastore
    var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
         
    await QueuedTask.Run(() =>
    {
      var realtimeServiceConProp = new RealtimeServiceConnectionProperties(
                                       new Uri(url),
                                       RealtimeDatastoreType.StreamService
                                    );
      using (var realtimeDatastore = new RealtimeDatastore(realtimeServiceConProp))
      {
        //A Realtime data store only contains **one** Realtime feature class (or table)
        var name = realtimeDatastore.GetTableNames().First();
        using (var realtimeFeatureClass = realtimeDatastore.OpenTable(name) as RealtimeFeatureClass)
        {
          //feature class, by default, is not streaming (opposite of the stream layer)
          realtimeFeatureClass.StartStreaming();
          //TODO use the feature class
          //...
        }
      }
    
    });
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also