pion / turn

Pion TURN, an API for building TURN clients and servers
MIT License
1.86k stars 317 forks source link

Build simple- on windows #368

Closed JohnQI8888 closed 9 months ago

JohnQI8888 commented 9 months ago

Your environment.

D:\gocode\turn\examples\turn-server\simple-multithreaded>git branch

D:\gocode\turn\examples\turn-server\simple-multithreaded>git log commit a980322aeb5fefdb93d626824ebf0c469ce4709d (HEAD -> master, origin/master, origin/HEAD) Author: Pion 59523206+pionbot@users.noreply.github.com Date: Tue Jan 2 19:17:55 2024 +0000

Update CI configs to v0.11.0

Update lint scripts and CI configs.

commit abd0ceda1de8cf000798d0ab8c931572b287f1b7

What did you do?

go build

What did you expect?

github.com/pion/turn/v3/examples/turn-server/simple-multithreaded

.\main.go:59:69: undefined: unix.SO_REUSEPORT

goversion

D:\gocode\turn\examples\turn-server\simple-multithreaded>go version go version go1.19.3 windows/amd64

What happened?

rg0now commented 9 months ago

Thanks for the report. As you can see, the examples/turn-server/simple-multithreaded example relies on the UNIX specific SO_REUSEPORT socket option that will not work on Windows. Except for multi-threading, this code is fully equivalent to examples/turn-server/simple which is compatible with Windows, so we recommend you use that code.