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

docs/Flowchart #36

Open
kadoshita opened this issue Feb 5, 2022 · 1 comment
Open

docs/Flowchart #36

kadoshita opened this issue Feb 5, 2022 · 1 comment
Labels

Comments

@kadoshita
Copy link
Owner

kadoshita commented Feb 5, 2022

graph TD
    Start --> STUN_MESSAGE_CHECK{Is STUN Message?};
    STUN_MESSAGE_CHECK --> |No| CHANNEL_NUMBER_CHECK{Has Channel Number?};
    CHANNEL_NUMBER_CHECK --> |Yes| SEND_APP_DATA_TO_PEER[Send Application Data to peer];
    CHANNEL_NUMBER_CHECK --> |No| FROM_PEER_CHECK{Receive From Peer?};
    FROM_PEER_CHECK --> |Yes| HAS_CHANNEL_NUMBER_CHECK{Has Channel Number?};
    HAS_CHANNEL_NUMBER_CHECK --> |Yes| SEND_CHANNEL_DATA_TO_CLIENT[Send Channel Data to client];
    HAS_CHANNEL_NUMBER_CHECK --> |No| SEND_DATA_INDICATE_TO_CLIENT[Send Data Indication to client];
    FROM_PEER_CHECK --> |No| UNKNOWN_DATA[Unknown Data];
    STUN_MESSAGE_CHECK --> |Binding Request| SEND_BIDING_RESPONSE[Send Binding Success/Error Response];
    STUN_MESSAGE_CHECK --> |Allocate Request| IS_CORRECT_USER_CHECK{Is Correct User?};
    IS_CORRECT_USER_CHECK --> |Yes| STORE_CLIENT_ENDPOINT[Store client endpoint];
    IS_CORRECT_USER_CHECK --> |No| SEND_ALLOCATE_ERROR_RESPONSE[Send Allocate Error Respoinse];
    STORE_CLIENT_ENDPOINT --> SEND_ALLOCATE_SUCCESS_RESPONSE[Send Allocate Success Response];
    STUN_MESSAGE_CHECK --> |Create Permission Request| IS_CLIENT_ENDPOINT_STORED_CHECK{Is client endpoint stored?};
    IS_CLIENT_ENDPOINT_STORED_CHECK --> |YES| STORE_PEER_ENDPOINT[Store peer endpoint];
    IS_CLIENT_ENDPOINT_STORED_CHECK --> |No| SEND_CREATE_PERMISSION_ERROR_RESPONSE[Send Create Permission Error Response];
    STORE_PEER_ENDPOINT --> SEND_CREATE_PERMISSION_SUCCESS_RESPONSE[Send Create Permission Success Response];
    STUN_MESSAGE_CHECK --> |Refresh Request| LIFETIME_ZERO_CHECK{Lifetime is 0?};
    LIFETIME_ZERO_CHECK --> |Yes| TERMINATE_CONNECTION[Terminate Connection];
    LIFETIME_ZERO_CHECK --> |No| SEND_REFRESH_RESPONSE[Send Refresh Success/Error Response];
    STUN_MESSAGE_CHECK --> |Channel Bind Request| STORE_CHANNEL_NUMBER_AND_PEER_ENDPOINT[Store Channel Number and Peer endpoint];
    STORE_CHANNEL_NUMBER_AND_PEER_ENDPOINT --> SEND_CHANEL_BIND_RESPONSE[Send Channel Bind Success/Error Response];
    STUN_MESSAGE_CHECK --> |Send Indicate| HAS_PERMISSION_CHECK{Has Permission?};
    HAS_PERMISSION_CHECK --> |Yes| P[Send Application Data to peer];
    HAS_PERMISSION_CHECK --> |No| UNKNOWN_DATA[Unknown Data];
Loading

TURNServer_Flowchart

@github-actions github-actions bot added the draft label Feb 5, 2022
@kadoshita
Copy link
Owner Author

Improve performance

graph TD
    Start --> HAS_STORED_CHANNEL_NUMBER_CHECK{Has stored Channel Number?};
    HAS_STORED_CHANNEL_NUMBER_CHECK --> |Yes| SEND_APP_DATA_TO_PEER[Send Application Data to peer];
    HAS_STORED_CHANNEL_NUMBER_CHECK --> |No| IS_RECEIVED_FROM_PEER{Is received from peer?};
    IS_RECEIVED_FROM_PEER --> |Yes| IS_CHANNEL_NUMBER_STORED_CHECK{Is channel number stored?};
    IS_CHANNEL_NUMBER_STORED_CHECK --> |Yes| SEND_CHANNEL_DATA_TO_CLIENT[Send Channel Data to client];
    IS_CHANNEL_NUMBER_STORED_CHECK --> |NO| SEND_DATA_INDICATE_TO_CLIENT[Send Data Indication to client];
    IS_RECEIVED_FROM_PEER --> |No| STUN_MESSAGE_CHECK{Is STUN Message?};    
    STUN_MESSAGE_CHECK --> |Send Indicate| IS_CLIENT_AND_PEER_STORED_CHECK{Is client and peer stored?};
    IS_CLIENT_AND_PEER_STORED_CHECK --> |Yes| SEND_APP_DATA_TO_PEER[Send Application Data to peer];
    IS_CLIENT_AND_PEER_STORED_CHECK --> |No| UNKNOWN_DATA[Unknown Data];
    STUN_MESSAGE_CHECK --> |Binding Request| SEND_BIDING_RESPONSE[Send Binding Success/Error Response];
    STUN_MESSAGE_CHECK --> |Allocate Request| IS_CORRECT_USER_CHECK{Is Correct User?};
    IS_CORRECT_USER_CHECK --> |Yes| STORE_CLIENT[Store client];
    STORE_CLIENT --> SEND_ALLOCATE_SUCCESS_RESPONSE[Send Allocate Success Response];
    IS_CORRECT_USER_CHECK --> |No| SEND_ALLOCATE_ERROR_RESPONSE[Send Allocate Error Respoinse];
    STUN_MESSAGE_CHECK --> |Create Permission Request| IS_CLIENT_STORED_CHECK1{Is client stored?};
    IS_CLIENT_STORED_CHECK1 --> |YES| STORE_PEER[Store peer];
    STORE_PEER --> SEND_CREATE_PERMISSION_SUCCESS_RESPONSE[Send Create Permission Success Response];
    IS_CLIENT_STORED_CHECK1 --> |No| SEND_CREATE_PERMISSION_ERROR_RESPONSE[Send Create Permission Error Response];
    STUN_MESSAGE_CHECK --> |Refresh Request| LIFETIME_ZERO_CHECK{Lifetime is 0?};
    LIFETIME_ZERO_CHECK --> |Yes| TERMINATE_CONNECTION[Terminate Connection];
    LIFETIME_ZERO_CHECK --> |No| SEND_REFRESH_RESPONSE[Send Refresh Success/Error Response];
    STUN_MESSAGE_CHECK --> |Channel Bind Request| IS_CLIENT_STORED_CHECK2{Is client stored?};
    IS_CLIENT_STORED_CHECK2 --> |Yes| STORE_CHANNEL_NUMBER_AND_PEER[Store Channel Number and Peer];
    STORE_CHANNEL_NUMBER_AND_PEER --> SEND_CHANEL_BIND_SUCCESS_RESPONSE[Send Channel Bind Success Response];
    IS_CLIENT_STORED_CHECK2 --> |No| SEND_CHANNEL_BIND_ERROR_RESPONSE[Send Channel Bind Error Response];
Loading

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant