I have modified your example: just added some networking to your go app.
I have attached the file to the letter.
Oh, I think, I haven't mentioned it before. To enable the networking in
the QEMU you need to add the following line to the run script:
```
append_qemu_nic_args
```
For me, localhost still wasn't available, so I was connecting to a
remote host.
---
gapfruit AG
Baarerstrasse 135
6300 Zug
+41 762 444 560
[email protected]
Alexander Tormasov писал 09.02.2021 19:46:
Thank you! I will try to return to this topic.
By the way, what test you do use for debugging?
Just to try to understand configs/etc - my genode network experience is
a bit limited...
Sincerely,
Alexander
1 февр. 2021 г., в 12:38, Sergey Platonov
<[email protected]> написал(а):
Hello all
We have invested some time analyzing golang and how much it will take
to make it production-ready.
The build system requires some effort, and it's not fully clear if
it's a one-time effort. Different golang projects use other build
systems (bazel and so on).
Networking is crucial for us, and we invested most of our time making
it work. Unfortunately, we failed to do so: it seems the goroutines
scheduler makes some assumptions that we overlooked. So, at the end of
the day, we have a network that sometimes works.
I have proposed a patch [1] that will fix some issues and hopefully
help someone later on.
Unfortunately, we will not invest more resources in porting golang
since it seems too resource-consuming for our small team.
[1] https://github.com/tor-m6/genode/pull/1
Regards, Sergey
--
gapfruit AG
Baarerstrasse 135
6300 Zug
+41 762 444 560
[email protected]
package main
import (
"fmt"
"net"
"os"
"runtime"
"strings"
)
func sendData(ipaddr string, port int, data []byte) {
var raddr net.TCPAddr
raddr.IP = net.ParseIP(ipaddr)
raddr.Port = port
conn, err := net.DialTCP("tcp4", nil, &raddr)
println("done")
if err != nil {
println("Dial failed:", err.Error())
os.Exit(1)
}
if conn != nil {
println("connected!")
} else {
println("conn == nil")
}
}
func main() {
// fmt.Println("cpu number", runtime.NumCPU())
sendData("94.130.141.228", 80, []byte("Hello, Genode!"))
// c0 := make(chan string)
// c1 := make(chan string)
// go sourceGopher(c0)
// go splitWords(c0, c1)
// printGopher(c1)
}
func sourceGopher(downstream chan string) {
for _, v := range []string{"hello world", "a bad apple", "goodbye all"} {
downstream <- v
}
close(downstream)
}
func splitWords(upstream, downstream chan string) {
for v := range upstream {
for _, word := range strings.Fields(v) {
downstream <- word
}
}
close(downstream)
}
func printGopher(upstream chan string) {
for v := range upstream {
fmt.Println(v)
}
}
_______________________________________________
Genode users mailing list
[email protected]
https://lists.genode.org/listinfo/users