-
Notifications
You must be signed in to change notification settings - Fork 64
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
Refactor pc_tranc.c #62
base: master
Are you sure you want to change the base?
Conversation
1. split sync and async code into different functions. 2. `pc__trans_resp`, `pc__trans_sent` and `pc__trans_fire_event` will not queue items, the pending arg has removed. 3. do state change in `pc_trans_fire_event` that is when event occurs, the state is changed not when the event his dispatched. 4. using a simple state machine for state change code in `pc_trans_fire_event`. TODO: remove extra indent for code marked with `// follow code has extra indent for better git diff in pull request.` after the pr is merged.
@cynron Any feedbacks? |
sorry, I am too busy these days, I will review this heavy PR carefully later. |
I think this change is not neccessary as the orignal works well, but even so, I think it should be in a seperated commit
awesome, as we had not used poll mode heavily, the poll mode is not well-tested in our use case. it is a bug, good catch
this looks good, but I think the impl can be better:
Thank you! |
I think its just use some bytes, but provide more readability and simple code. |
IMHO, works well is not sufficient reason for doing sync and async in one single function. |
#66 is merged, awesome |
pc_tranc.c
into different functions.pc__trans_resp
,pc__trans_sent
andpc__trans_fire_event
will not queue items, thepending
arg has removed.pc_trans_fire_event
, that is when event occurs, the state is changed not when the event is dispatched. ( this shuld fixes Assertion fail when connect and disconnect then cleanup without delay. #60 )pc_trans_fire_event
.TODO: remove extra indent for code marked with
// follow code has extra indent for better git diff in pull request.
after the pr is merged.