Git Product home page Git Product logo

Comments (6)

marten-seemann avatar marten-seemann commented on September 22, 2024

You can construct a Transport with a UPDConn that you created yourself.

from quic-go.

lakhalouahid avatar lakhalouahid commented on September 22, 2024

Thanks @marten-seemann for the feedback.
I tried to create a transport from UDPConn. But i didn't know how to do it properly because transport.Dial return the error: INTERNAL_ERROR (local): write udp 127.0.0.1:44746->127.0.0.1:59951: use of WriteTo with pre-connected connection
This is the part the code, i did use:

	tConn, err := net.DialUDP("udp", lAddr, rAddr)
	if err != nil {
		sugar.Debug("Could not create UDP connection: %v", err)
	}

	transport := &quic.Transport{Conn: tConn}

	conn, err = transport.Dial(ctx, rAddr, tlsConfig, quicConfig)
	if err != nil {
		sugar.Debug("Connect to quic server failed: ", err)
	}

from quic-go.

marten-seemann avatar marten-seemann commented on September 22, 2024

It’s all explained in the README.

from quic-go.

lakhalouahid avatar lakhalouahid commented on September 22, 2024

Thanks @marten-seemann again. Actually, i did check the README, and i did just find a implementation for the server. But, i need to specify source port of the client. When defining the server, no client is connected to server so the transfer of net.UDPConn to quic.Connection will work, but how about the client if he already connected. And the problem, is that internally the function writeTo is called instead of write.

from quic-go.

marten-seemann avatar marten-seemann commented on September 22, 2024

Use ListenUDP instead of DialUDP. Just like it says in literally the first paragraph of the README.

from quic-go.

lakhalouahid avatar lakhalouahid commented on September 22, 2024

Solved. Thank you @marten-seemann.

from quic-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.