rtp.Session.WriteData returns 0 regardless of whether the write was successful
Hello and thanks for a very useful library.
I've noticed that func (rs *Session) WriteData(rp *DataPacket) (n int, err error)
always returns n=0 regardless of the outcome of writing into transport.
Looks like the named return value n is never being assigned.
https://github.com/wernerd/GoRTP/blob/master/src/net/rtp/session.go#L716
Is this expected behaviour?
Thanks!
Hi,
thanks for the catch. No, this isn't expected behaviour. If no error occurs the function should return the number of bytes sent.
IMHO you should change the code and test this fix:
n, err:=rs.transportWrite.WriteDataTo(rp, remote)
The transport just calls the Go WriteToUDP(..) function which returns the number of bytes written and a possible error.
BTW, the function that handles the RTCP data has the same issue :-) - does not set 'n'.
Regards, Werner
Am 12.08.19 um 18:22 schrieb Anton Kozlov:
Hello and thanks for a very useful library.
I've noticed that |func (rs *Session) WriteData(rp *DataPacket) (n int, err error)| always returns |n=0| regardless of the outcome of writing into transport.
Looks like the named return value |n| is never being assigned.
https://github.com/wernerd/GoRTP/blob/master/src/net/rtp/session.go#L716
Is this expected behaviour?
Thanks!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wernerd/GoRTP/issues/9?email_source=notifications&email_token=AAD6DEM7HG3S2T35WAXYVVLQEGE4BA5CNFSM4ILC4B5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HEYGAOA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD6DEKHCTIPMP4R72UVC53QEGE4BANCNFSM4ILC4B5A.
-- Werner Dittmann email: [email protected] cell: +49 173 44 37 659 PGP key: 82EF5E8B