Skip to content

Infinite C threads are created when device is off and the process tries to connect multiple times #46

Description

@rohitrgupta

Following generate huge number of C threads when the device is not up

``package main

import (
"fmt"
"time"

"github.com/wendy512/iec61850"

)

func main() {
// Start some goroutines
for i := 0; i < 10; i++ {
go connectClient(i)
}
time.Sleep(time.Hour)
}

func connectClient(id int) {
for {
settings := iec61850.NewSettings()
settings.Host = "192.168.1.102"
settings.Port = 102

	_, err := iec61850.NewClient(settings)
	if err != nil {
		fmt.Println("Error creating IEC61850 client:", id, err)
	} else {
		fmt.Println("Successfully created IEC61850 client:", id)
		return
	}
}

}
``

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions