1 Reply Latest reply on Oct 15, 2015 8:53 AM by hyunkook RSS
    hyunkook Explorer

    C# SteamSensorClient Sample Test Error  (Code 1001)?

    C# SteamSensorClient Sample Test Error


    I do not know why the connection error

    Make sure that any problems with the following code:



    var config = new ClientConfigurator();


                // The uri for connecting to Thingworx
                config.Uri = "[ |]";


                // Reconnect every 15 seconds if a disconnect occurs or if initial connection cannot be made
                config.ReconnectInterval = 1;


               // Credentials Example


                SecurityClaims claims = new SecurityClaims();
                claims.addClaim(RESTAPIConstants.PARAM_APPKEY, "df7cd577-39f1-48c3-a00d-81e1ad22c14d");


               // claims.addClaim(RESTAPIConstants.PARAM_USERID, "frontis02");


               // claims.addClaim(RESTAPIConstants.PARAM_PASSWORD, "frontis02");



                // Set the security using an Application Key
                var appKey = "df7cd577-39f1-48c3-a00d-81e1ad22c14d";
               // var claims = SecurityClaims.fromAppKey(appKey);
                config.Claims = claims;



                // Set the name of the client
                config.Name = "SteamSensorGateway";


                // Get the scan rate (milliseconds) that is specific to this example
                // The example will execute the processScanRequest of the VirtualThing
                // based on this scan rate
                int scanRate = Int32.Parse("1");


                // Create the client passing in the configuration from above
                SteamSensorClient client = new SteamSensorClient(config);
                    // Create two Virtual Things
                    SteamThing sensor1 = new SteamThing("Temperature", "1st Floor Steam Sensor", "Temperature", client);
                    SteamThing sensor2 = new SteamThing("Humidity", "2nd Floor Steam Sensor", "Humidity", client);


                    // Bind the Virtual Things


                    // client.connect();
                    // Start the client
                catch (Exception eStart)
                    Console.WriteLine("Initial Start Failed : " + eStart.Message);




      _message=Error opening connecting to Platform. There was an error initializing the Socket. (Code 1001)
      Message=Error opening connecting to Platform. There was an error initializing the Socket. (Code 1001)