Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udp port range not work #493

Open
mouuii opened this issue Oct 9, 2024 · 1 comment
Open

udp port range not work #493

mouuii opened this issue Oct 9, 2024 · 1 comment

Comments

@mouuii
Copy link

mouuii commented Oct 9, 2024

I want to set the udp port range ,but doesn't work.
so i change the code in rtspv2 pkg by 'replace github.com/deepch/vdk v0.0.27 => ./vdk', to use net.dail with local port as below 。 Do you have any ideal ? @deepch

func StreamServerRunStream(name string) (bool, error) {
	keyTest := time.NewTimer(20 * time.Second)
	Control := Storage.StreamControl(name)
	var preKeyTS = time.Duration(0)
	var Seq []*av.Packet
	RTSPClient, err := rtspv2.Dial(rtspv2.RTSPClientOptions{URL: Control.URL, DisableAudio: true, DialTimeout: 3 * time.Second, ReadWriteTimeout: time.Second * 5 * time.Second, Debug: Control.Debug})
	if err != nil {
		return false, errors.New("RTSP Client Error " + err.Error())
	}
	Storage.StreamStatus(name, ONLINE)
	defer func() {
		RTSPClient.Close()
		Storage.StreamStatus(name, OFFLINE)
	}()
     ... 
}

// in another repo vdk , package rtspv2
func Dial(options RTSPClientOptions) (*RTSPClient, error) {
         ...

	d := net.Dialer{Timeout: client.options.DialTimeout, LocalAddr: &net.TCPAddr{
		IP:   net.ParseIP("0.0.0.0"),
		Port: 30043,
	}}
	conn, err := d.Dial("tcp", client.pURL.Host)
	//conn, err := net.DialTimeout("tcp", client.pURL.Host, client.options.DialTimeout)
@mouuii
Copy link
Author

mouuii commented Oct 17, 2024

ping @deepch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant