Skip to content

Commit

Permalink
feat(lib): override equals and hashcode to compare with internal srt …
Browse files Browse the repository at this point in the history
…socket
  • Loading branch information
ThibaultBee committed Jul 4, 2024
1 parent 95ca5b5 commit d1d3df2
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,20 @@ private constructor(private val srtsocket: Int) : Closeable {
*/
fun available(): Int = getSockFlag(SockOpt.RCVDATA) as Int

/**
* Return [true] if internal SRT socket are equals
*/
override fun equals(other: Any?): Boolean {
if (other is Socket) {
return other.srtsocket == srtsocket
}
return false
}

override fun hashCode(): Int {
return srtsocket.hashCode()
}

/**
* This interface is used by a server [Socket] to notify SRT socket events.
*/
Expand Down

0 comments on commit d1d3df2

Please sign in to comment.