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

wip: feat: implementing trickle ice #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rprata
Copy link

@rprata rprata commented Apr 22, 2022

wip

@rprata rprata force-pushed the feat/trickle-ice branch 2 times, most recently from 803e32d to fab6fc2 Compare April 22, 2022 02:10
host_candidates, host_protocols = await self.get_host_candidates(
component, addresses
)
candidates.append(host_candidates)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks wrong, you're appending a list to a list. Did you mean candidates += host_candidates ?

async def query_stun_server(
self, host_protocols: List[StunProtocol], timeout: int = 5
) -> Optional[List[Candidate]]:
candidates = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply initialise candidates to an empty list instead of having to deal with None?

# query STUN server for server-reflexive candidates (IPv4 only)
return candidates, host_protocols

async def query_stun_server(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a private method, prefix it with an underscore

async def get_component_candidates(
self, component: int, addresses: List[str], timeout: int = 5
) -> List[Candidate]:
async def get_host_candidates(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private method, prefix it with an underscore

host_protocols=host_protocols, timeout=timeout
)
if srflx_candidates:
candidates.append(srflx_candidates)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, candidates += srflx_candidates and you can drop the if.

src/aioice/ice.py Outdated Show resolved Hide resolved
@jlaine
Copy link
Collaborator

jlaine commented Apr 22, 2022

The CI errors look specific to your branch, I've re-run the tests on the main branch and I'm not getting errors. see https://github.com/jlaine/aioice/actions/runs/2205560373

I have to admit I don't see where this code is going. I was expecting something like gather() becoming an async iterator. Also the "hard" changes are going to concern candidate pairing: you can no longer count on having all your local candidates before you start adding remote candidates.

@rprata rprata force-pushed the feat/trickle-ice branch 2 times, most recently from 39dee70 to be6fd70 Compare April 22, 2022 13:12
@rprata
Copy link
Author

rprata commented Apr 22, 2022

The CI errors look specific to your branch, I've re-run the tests on the main branch and I'm not getting errors. see https://github.com/jlaine/aioice/actions/runs/2205560373

Sorry, I made something wrong in my local environment.

I have to admit I don't see where this code is going. I was expecting something like gather() becoming an async iterator. Also the "hard" changes are going to concern candidate pairing: you can no longer count on having all your local candidates before you start adding remote candidates.

I thought at that moment refactor the function get_component_candidates and then find a way to use the gather for each element in local candidates step can be called concurrently and provide an intermediate local candidates list ASAP to send offer . Do you agree or you see another point?

@jlaine
Copy link
Collaborator

jlaine commented Apr 23, 2022

I still think you probably want an async iterator at the end of the day, so that we can yield the candidates as we collect them. That way API users can do:

async for candidate in conn.gather():
    do_something(candidate)

Obviously feel free to suggest a different API! I think taking a look at what other implementations are doing might be of value too before diving into the nitty-gritty work.

@codecov
Copy link

codecov bot commented Apr 23, 2022

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.25 ⚠️

Comparison is base (fe817e6) 100.00% compared to head (15b2853) 99.75%.

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #56      +/-   ##
===========================================
- Coverage   100.00%   99.75%   -0.25%     
===========================================
  Files            7        7              
  Lines         1200     1213      +13     
===========================================
+ Hits          1200     1210      +10     
- Misses           0        3       +3     
Impacted Files Coverage Δ
src/aioice/ice.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abhinavsingh
Copy link

@rprata @jlaine Just landed on this PR looking for Trickle support but last activity here was almost an year ago, which makes me sad :(. Any hope on getting this PR in anytime soon guys. Thank you!!!

@jlaine
Copy link
Collaborator

jlaine commented Jul 5, 2023

@rprata @jlaine Just landed on this PR looking for Trickle support but last activity here was almost an year ago, which makes me sad :(. Any hope on getting this PR in anytime soon guys. Thank you!!!

Just to clarify, this PR doesn't implement trickle ICE, as it stands it just does some refactoring.

@rprata
Copy link
Author

rprata commented Jul 12, 2023

@rprata @jlaine Just landed on this PR looking for Trickle support but last activity here was almost an year ago, which makes me sad :(. Any hope on getting this PR in anytime soon guys. Thank you!!!

Just to clarify, this PR doesn't implement trickle ICE, as it stands it just does some refactoring.

Sorry @jlaine, but I can't continue this work now. Feel free to this ti close the PR.

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.

3 participants