bine icon indicating copy to clipboard operation
bine copied to clipboard

Support embedded control socket on Windows

Open cretz opened this issue 6 years ago • 4 comments

Now that https://github.com/golang/go/issues/24331 landed, have a Windows version that creates a syscall.RawConn from the socket and implement the rest of net.Conn w/ dummy stuff. Also update the README and package docs.

cretz avatar Dec 28 '18 03:12 cretz

I'm afraid this still isn't enough to easily make a net.Conn out of a Windows socket. I would end up duplicating the FileConn efforts done in the Go repo issue referenced in #13.

cretz avatar Jan 17 '19 19:01 cretz

I would like to implement this, can you give some more info on where to start?

lu4p avatar Mar 03 '19 23:03 lu4p

@lu4p - Hi. This is a bit of work. I've played with it some, and you'll end up using syscalls to winsock APIs among other things. At first it seems trivial to take a socket handle and create a net.Conn, just reads, writes, some deadlines, etc. However, it becomes tricky to do from a syscall.RawConn as we're given now. The best way would be to implement it in Go (see the referenced issues), but in the meantime the ideal way to solve this would be to create a simple project that properly implements net.Conn with a Windows socket handle. I'll gladly leverage it.

cretz avatar Mar 05 '19 14:03 cretz

Adding help wanted tag. Until the Go issues mentioned in the PR at #13 are done, this would be a manual effort w/ syscall.

cretz avatar Jun 13 '21 02:06 cretz