Setting the MTU will change the buffer size, but there might still be segments of the previous MSS size in the kcp.snd_buf. When calling flush for transmission, will causes a panic.
ptr = segment.encode(ptr) copy(ptr, segment.data) ptr = ptr[len(segment.data):]
Setting the MTU will change the buffer size, but there might still be segments of the previous MSS size in the kcp.snd_buf. When calling flush for transmission, will causes a panic.
ptr = segment.encode(ptr) copy(ptr, segment.data) ptr = ptr[len(segment.data):]