Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net.Listener support #1615

Closed
PumpkinSeed opened this issue Nov 19, 2018 · 2 comments
Closed

net.Listener support #1615

PumpkinSeed opened this issue Nov 19, 2018 · 2 comments

Comments

@PumpkinSeed
Copy link

Hi,

Is there a chance to have support of net.Listener? I wanted to try it out and I got the following error:

cannot use lis (type quic.Listener) as type net.Listener in argument to grpcServer.Serve:
    quic.Listener does not implement net.Listener (wrong type for Accept method)
        have Accept() (quic.Session, error)
        want Accept() (net.Conn, error)
@lucas-clemente
Copy link
Member

The concepts behind quic (e.g. multiple [uni-directional] streams over one connection) don't map well to the current Go stdlib types, so we don't implement them exactly. Most of the API is similar though wherever possible.

In the end most people will likely just use QUIC as a drop-in replacement for HTTP, and that fortunately easy enough (look at the h2quic package).

@james-lawrence
Copy link

I think the assertion they don't map well was premature. only pieces that would need to be special cased is the dialer and listener.

just repeatedly 'dial' a server to get mulitple conn's and each conn would have a duplex uni directional stream (which is what standard tcp connections have anyways)....

even if such an interface doesn't grant the full power of quic it'd still be handy for interop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants