gortc / stun

Fast RFC 5389 STUN implementation in go
BSD 3-Clause "New" or "Revised" License
494 stars 53 forks source link

WIP: client: Initial PacketConn refactoring. #42

Closed backkem closed 6 years ago

backkem commented 6 years ago

This WIP PR addresses #41. I created it already to get some early feedback. Still TODO:

High-level overview of changes:

I'm not entirely happy with having to call HandleTransactions after starting the client in simple use-cases. I'm not sure if there is an obvious way to solve this. In addition, there is an unlikely 'deadlock' scenario in stun-traversal if a non-stun message is received before the response to the binding request. This shows that, while convenient, the blocking API does have some caveats. Lastly, I haven't put much thought into it but this implementation of stun.Client may be usable as a server as well.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-2.3%) to 97.671% when pulling c555e87131671454bc5e9ac605fa1aa3c3f48c5a on backkem:packetconn into ca38c5ce13a5f6315da72b834c6c861ff52be12c on gortc:master.