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

feat: add the api for fetching the connection type #20

Merged
merged 2 commits into from
Dec 20, 2022

Conversation

x-epoch
Copy link
Contributor

@x-epoch x-epoch commented Dec 19, 2022

API for fetching the the connection type, which would return the type of Promise<'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'>.
Details can refer to https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-379327

src/peer-connection.spec.ts Show resolved Hide resolved
src/peer-connection.ts Show resolved Hide resolved
*
* @returns The connection type which would be {Promise<'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown'>}.
*/
async getCurrentConnectionType(): Promise<string> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering if it's worth explicitly defining a type for these: instead of string, doing something like:

const ConnectionType = 'UDP' | 'TCP' | 'TURN-TLS' | 'TURN-TCP' | 'TURN-UDP' | 'unknown';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I have already updated this code .

@bbaldino bbaldino merged commit 4e5fe55 into webex:main Dec 20, 2022
github-actions bot pushed a commit that referenced this pull request Dec 20, 2022
# [1.3.0](v1.2.0...v1.3.0) (2022-12-20)

### Features

* add the api for fetching the connection type ([#20](#20)) ([4e5fe55](4e5fe55))
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