Skip to content

why udp proxy forward data like stream? #109

@xiaotushaoxia

Description

@xiaotushaoxia
		read, err := proxyConn.Read(readBuf)
		// ....
		for i := 0; i != read; {
			written, err := proxy.listener.WriteToUDP(readBuf[i:read], clientAddr)
			if err != nil {
				return
			}
			i += written
		}

udp is datagram protocol, this code looks like readBuf is a stream of bytes. Sending a 10 byte datagram is different from sending two 5-byte datagrams

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions