Skip to content

YunClient connect retries #2436

Closed
Closed
@fiosca

Description

@fiosca

We're using the latest version (1.5.8) and the latest linino firmware and we think there's a problem with the connect method of the YunClient.

Problem is quite simple, after 256 connect failures, the Python bridge enters an infinite loop and stop responding at all (you can check the method "connect" of the SocketServer bridge class). This is a source code that can replicate the problem:

#include <Bridge.h>
#include <Process.h>
#include <YunClient.h>

#define CM24_SOCKET_URL                 "www.anyaddress.local"
#define CM24_SOCKET_PORT                3503

long loopCounter = 0;

YunClient *yunClient = new YunClient();

void setup() 
{
  Serial.begin(9600);
  while(!Serial);  // wait for Serial port to connect.  

  Bridge.begin();
  Serial.println("* SETUP DONE *");
}

void loop()
{
  loopCounter++;    

  Serial.println("Loop " + String(loopCounter));
  //Try connect
  yunClient->connect(CM24_SOCKET_URL, CM24_SOCKET_PORT);    

}

There's no way to fix the problem, because Arduino thinks that client is not connected and issuing a "stop" doesn't led to any solution...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DuplicateAnother item already exists for this topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions