Skip to content

Commit

Permalink
[docs] Updated outdated API info
Browse files Browse the repository at this point in the history
  • Loading branch information
ethouris authored and maxsharabayko committed Dec 17, 2020
1 parent 88affe5 commit 4b7616a
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,17 @@ it is used to define a point of communication.
### Synopsis

```c++
SRTSOCKET srt_socket(int af, int, int);
SRTSOCKET srt_create_socket();
int srt_close(SRTSOCKET s);
```
The `srt_socket` function is based on the legacy UDT API except
the first parameter. The other two are ignored.
Note that `SRTSOCKET` is just an alias for `int`; this is a legacy naming convention
from UDT, which is here only for clarity.
### Usage
```c++
sock = srt_socket(AF_INET, SOCK_DGRAM, 0);
sock = srt_create_socket();
```

This creates a socket, which can next be configured and then used for communication.
Expand Down Expand Up @@ -105,7 +102,7 @@ the _rendezvous_ mode.
```c++
int srt_bind(SRTSOCKET u, const struct sockaddr* name, int namelen);
int srt_bind_peerof(SRTSOCKET u, UDPSOCKET udpsock);
int srt_bind_acquire(SRTSOCKET u, UDPSOCKET udpsock);
```

This function sets up the "sockname" for the socket, that is, the local IP address
Expand All @@ -114,8 +111,8 @@ this can be done on both listening and connecting sockets; for the latter it wil
define the outgoing port. If you don't set up the outgoing port by calling this
function (or use port number 0), a unique port number will be selected automatically.

The `*_peerof` version simply copies the bound address setting from an existing
UDP socket.
The `*_acquire` version simply takes over the given UDP socket and copies the
bound address setting from it.

```c++
int srt_listen(SRTSOCKET u, int backlog);
Expand Down Expand Up @@ -705,4 +702,4 @@ for Buffer API.
For more information, see [APISocketOptions.md](APISocketOptions.md).

[Return to top](#srt-api)


0 comments on commit 4b7616a

Please sign in to comment.