Comments (4)
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.
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.
application level timeouts is the right and only way to solve it.
from kcp-go.
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)
- 是不是可以修改session的fec配置? HOT 2
- is there a way to support non-block read?
- Write方法返回时不能保证数据写到了对方缓冲区 HOT 7
- Add exam in examples
- UDPSession.WriteBuffers里面的timeout 有内存泄漏风险 HOT 2
- why IKCP_OVERHEAD is 24bytes HOT 2
- Just need some help and explanation
- write to non-existent host does not cause an error
- packetInput 允许用户自行处理解码失败的UDP包
- is it possible to disable ack, for use in unidirectional network.
- 希望Listener上能提供一个NewUdpSession的方法
- 如何提升kcp的速度? HOT 4
- kcp.(*UDPSession).update 存在内存泄漏? HOT 19
- 为什么一重启服务器端,就收不到客户端传来的信息呢
- 服务器链接超过某个数后内存暴涨 HOT 1
- 如何抵御重放攻击(How to defend against replay attacks)? HOT 1
- 用户数据过大时,会出现数据错乱问题 HOT 3
- 只能通过UDPSession.Close才能跳出readloop循环,如果通过调用SetXXXDeadline的方式,会造成协程泄露。 HOT 1
- 在穿越了NAT的P2P隧道里,使用kcp.NewConn2建立的一对连接无法成功通信
- 请教一个dynamic fec的参数问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kcp-go.