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

Allow connections returned by go-stun to be used (for hole-punching, etc). #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kenkeiter
Copy link

Per my earlier comment, go-stun was not properly relinquishing control over connections returned by stun.Discover() -- the Agent readloop was still active, which was intercepting all messages sent to the socket.

For me, this set of changes fixed the issue. It introduces a very simple Stop method on the Agent, which pushes a struct to a channel that either of the Agent read loops may select to exit the read loop, effectively relinquishing the connection.

Tests (such as they are) still pass. I'm not sure this is the best/most complete solution, but it made this library usable for me.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 62.693% when pulling 7a0bcf3 on kenkeiter:master into 2295297 on pixelbender:master.

@kenkeiter kenkeiter mentioned this pull request Sep 25, 2017
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

Successfully merging this pull request may close these issues.

2 participants