Skip to content

Commit

Permalink
Merge pull request #44 from Sense-Scape/43-bug-constantly-growing-mem…
Browse files Browse the repository at this point in the history
…ory-footprint

Fix: Fixing data proc handling
  • Loading branch information
Grabt234 authored Aug 1, 2024
2 parents 221084a + b5162e0 commit 42adde8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Routines/TCPRXRoutine.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ func HandleTCPReceivals(configJson map[string]interface{}, loggingChannel chan m
}

byteArray = append(byteArray, buffer[:bytesRead]...)

// check if byte array is large enough
if len(byteArray) > 512 {
for {

if len(byteArray) < 512{
break
}

// Expected byte Format
// |Transport Header(2)| [Session Header(23)|Session Data(x)] |
Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ import (
"time"
"github.com/Sense-Scape/Go_TCP_Websocket_Adapter/v2/Routines"
"github.com/rs/zerolog"
// _ "net/http/pprof"
// "net/http"
)

func main() {

// uncomment to allow remote memory debugging
// go func() {
// log.Println(http.ListenAndServe("localhost:6060", nil))
// }()

// Create a decoder to read JSON data from the file
// Open the JSON file for reading
routineCompleteChannel := make(chan bool)
Expand Down

0 comments on commit 42adde8

Please sign in to comment.