You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Println("Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.")
152
-
} elseif*gcType=="max" {
153
-
log.Println("Garbage collection is on for MAXIMUM real-time collecting on each send/recv from serial port. Higher CPU, but less stopping of the world to garbage collect since it is being done on a constant basis.")
154
-
} else {
155
-
log.Println("Garbage collection is off. Memory use will grow unbounded. You WILL RUN OUT OF RAM unless you send in the gc command to manually force garbage collection. Lower CPU, but progressive memory footprint.")
156
-
debug.SetGCPercent(-1)
157
-
}
143
+
// hostname
144
+
hn, _:=os.Hostname()
145
+
if*hostname=="unknown-hostname" {
146
+
*hostname=hn
147
+
}
148
+
log.Println("Hostname:", *hostname)
149
+
150
+
// turn off garbage collection
151
+
// this is dangerous, as u could overflow memory
152
+
//if *isGC {
153
+
if*gcType=="std" {
154
+
log.Println("Garbage collection is on using Standard mode, meaning we just let Golang determine when to garbage collect.")
155
+
} elseif*gcType=="max" {
156
+
log.Println("Garbage collection is on for MAXIMUM real-time collecting on each send/recv from serial port. Higher CPU, but less stopping of the world to garbage collect since it is being done on a constant basis.")
157
+
} else {
158
+
log.Println("Garbage collection is off. Memory use will grow unbounded. You WILL RUN OUT OF RAM unless you send in the gc command to manually force garbage collection. Lower CPU, but progressive memory footprint.")
159
+
debug.SetGCPercent(-1)
160
+
}
158
161
159
-
ip:="0.0.0.0"
160
-
log.Print("Starting server and websocket on "+ip+""+f.Value.String())
162
+
ip:="0.0.0.0"
163
+
log.Print("Starting server and websocket on "+ip+""+f.Value.String())
161
164
162
-
log.Println("The Arduino Create Agent is now running")
165
+
log.Println("The Arduino Create Agent is now running")
163
166
164
-
// see if they provided a regex filter
165
-
iflen(*regExpFilter) >0 {
166
-
log.Printf("You specified a serial port regular expression filter: %v\n", *regExpFilter)
167
-
}
167
+
// see if they provided a regex filter
168
+
iflen(*regExpFilter) >0 {
169
+
log.Printf("You specified a serial port regular expression filter: %v\n", *regExpFilter)
170
+
}
168
171
169
-
// list serial ports
170
-
portList, _:=GetList(false)
171
-
log.Println("Your serial ports:")
172
-
iflen(portList) ==0 {
173
-
log.Println("\tThere are no serial ports to list.")
174
-
}
175
-
for_, element:=rangeportList {
176
-
log.Printf("\t%v\n", element)
172
+
// list serial ports
173
+
portList, _:=GetList(false)
174
+
log.Println("Your serial ports:")
175
+
iflen(portList) ==0 {
176
+
log.Println("\tThere are no serial ports to list.")
177
+
}
178
+
for_, element:=rangeportList {
179
+
log.Printf("\t%v\n", element)
177
180
178
-
}
181
+
}
179
182
180
-
if!*verbose {
181
-
log.Println("You can enter verbose mode to see all logging by starting with the -v command line switch.")
182
-
log.SetOutput(new(NullWriter)) //route all logging to nullwriter
183
-
}
183
+
if!*verbose {
184
+
log.Println("You can enter verbose mode to see all logging by starting with the -v command line switch.")
185
+
log.SetOutput(new(NullWriter)) //route all logging to nullwriter
186
+
}
184
187
185
-
// launch the hub routine which is the singleton for the websocket server
0 commit comments