Coder Social home page Coder Social logo

Unexpected behavior about kcp-go HOT 4 CLOSED

xtaci avatar xtaci commented on May 21, 2024
Unexpected behavior

from kcp-go.

Comments (4)

xtaci avatar xtaci commented on May 21, 2024
    for {
        c, err := l.Accept()
        if err != nil {
            panic(err)
        }
        c.Write([]byte("hi"))
        n, err := c.Read(b)
        fmt.Println("LISTEN", string(b[:n]), err)
    time.Sleep(time.Second)   /// this will let listener send data to client
        c.Close()
    }

your output tells that client tries to retransmit hello message, but the listener never had a chance to send data, because it's closed immediately after Read().

KCP doesn't define session control messages like SYN/FIN/RST in TCP, a real world example is to use some multiplexing protocol over session, such as yamux.

from kcp-go.

AudriusButkevicius avatar AudriusButkevicius commented on May 21, 2024

I am more worried that the dial part keeps trying to send data even after Close(). I fully understand that there is no session control, but TIME_WAIT could be implemented based on the convID on the listen side, essentially ignoring all packets for some time.

Regarding the timeout, not sure why you've pointed at this issue as it's somewhat a different question.
I saw that there was a local var related to connection timeout, but it's not used anywherr.

Are you saying application level timeouts is the right and only way to solve it? Or are you saying yamux solves it?

from kcp-go.

xtaci avatar xtaci commented on May 21, 2024

application level timeouts is the right and only way to solve it.

from kcp-go.

AudriusButkevicius avatar AudriusButkevicius commented on May 21, 2024

I see yamux has some tcp like control messages which might help solve this, I'll see where that takes me.

from kcp-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.