diff options
| author | bt <bt@rctt.net> | 2026-03-10 14:10:41 +0100 |
|---|---|---|
| committer | bt <bt@rctt.net> | 2026-03-10 14:10:41 +0100 |
| commit | 6dcbb66fcafce3da6d7c00d9679946b77f6f6186 (patch) | |
| tree | bf5b4dc13290cad2fcf9432051a0dcc2149749cf | |
| parent | 49f27239bfeae275c06fc21035b9835542a87612 (diff) | |
| download | solec-6dcbb66fcafce3da6d7c00d9679946b77f6f6186.tar.gz solec-6dcbb66fcafce3da6d7c00d9679946b77f6f6186.zip | |
Fix client and server
| -rw-r--r-- | cmd/client/main.go | 20 | ||||
| -rw-r--r-- | cmd/test/main.go | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/cmd/client/main.go b/cmd/client/main.go index 8bb1c24..bf28e87 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -36,6 +36,26 @@ func ping(conn net.Conn) { if _, err := conn.Write(data); err != nil { panic(err) } + + test := core.Test{ + Num1: 1, + Time1: time.Now(), + Str1: "test string", + Num2: 2, + Bin1: []byte{0x01, 0x02, 0x03}, + Num3: 3, + Str2: "こんにちは", + Num4: 4, + } + + data, err = core.Encode(test) + if err != nil { + panic(err) + } + if _, err = conn.Write(data); err != nil { + panic(err) + } + time.Sleep(time.Second) } } diff --git a/cmd/test/main.go b/cmd/test/main.go index e580b63..35eddad 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "fmt" "time" @@ -25,7 +26,7 @@ func main() { } fmt.Printf("% X\n", data) - out, err := core.Decode(data) + out, err := core.Decode(bytes.NewBuffer(data)) if err != nil { panic(err) } |
