Author SHA1 Message Date
Mike Holloway a46c855960 On branch timer
Changes to be committed:
	modified:   main.go
		Add call to timer
	new file:   timer/timer.go
		New 10 second timer
2021-06-25 00:20:30 -04:00
Mike Holloway 0ea14fd132 On branch fix-colons
Changes to be committed:
	modified:   main.go
		No longer replacing colons with ','
2021-06-24 23:01:12 -04:00
2 changed files with 25 additions and 1 deletions

No files matched your search

+4 -1
View File
@@ -1,5 +1,7 @@
package main
import (
"./timer"
"fmt"
"strings"
"regexp"
@@ -16,6 +18,7 @@ func main() {
// and then converted byte by byte (2 char at a time)
//fmt.Println(convert_address(reverse_string(reverse_bytes("0100007F"))))
timer.New()
tcp_rows(read_tcp_file("/proc/net/tcp"))
}
@@ -26,7 +29,7 @@ func check(e error) {
}
func tcp_rows(connections_file string) {
regexpression := regexp.MustCompile(`[^a-zA-Z0-9\r\n\t\v]+`)
regexpression := regexp.MustCompile(`[^a-zA-Z0-9:\r\n\t\v]+`)
tcp_lines := strings.Split(connections_file, "\n")
for _, line := range tcp_lines {
+21
View File
@@ -0,0 +1,21 @@
package timer
import (
"fmt"
"time"
//"reflect"
)
func New() {
timer_10s := time.NewTimer(10 * time.Second)
// timer_1m := time.NewTimer(1 * time.Minute)
fmt.Println("Waiting 10 seconds...")
<-timer_10s.C
// for elapsed < ten_seconds {
//}
// for
}