The Python runtime allows it by pickling the connection. Is there a similar way to share sockets using the Go runtime on classic App Engine with google.golang.org/appengine/socket
?
The descriptor isn't exposed in the Go API: https://github.com/golang/appengine/blob/master/socket/socket_classic.go#L152
type Conn struct {
ctx context.Context
desc string
offset int64
prot pb.CreateSocketRequest_SocketProtocol
local, remote *pb.AddressPort
readDeadline, writeDeadline time.Time // optional
}
desc
is what you would need on the other side to reconstruct the socket.
It should be possible fork this library on GitHub, change the conn struct to expose the needed desc
property, and then change the import to github.com/YOURUSERNAME/appengine/socket
instead of appengine/socket
.
It's a lot of work so if you can come up with a different way to solve this you're probably better off. Nevertheless it should be possible.