tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
15.4k stars 909 forks source link

TinyGo, TCP/UDP, Linux #1776

Open en-v opened 3 years ago

en-v commented 3 years ago

Hi there! I want to create an application for a Linux-based IP-camera with TinyGo but I found that TinyGo doesn't support the "net" package. How can I get access to TCP/UDP data-transmission with TinyGo? I have only two ideas (CGO and "netcat" piping) but it looks like crutches ((

UPD: the "netcat" piping is impossible because the "os/exec" package doesn't supported too.

abrander commented 3 years ago

@en-v You could use tinynet: https://github.com/alphahorizonio/tinynet

If tinynet is too big, you can implement basic networking pretty easily using raw syscalls.

aykevl commented 3 years ago

Right now, Linux isn't a primary use case for TinyGo. However, we're working on getting the net package working eventually.