Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
parse_socket_addr.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Roc Streaming authors
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 */
8
9//! @file roc_address/parse_socket_addr.h
10//! @brief Parse address from string.
11
12#ifndef ROC_ADDRESS_PARSE_SOCKET_ADDR_H_
13#define ROC_ADDRESS_PARSE_SOCKET_ADDR_H_
14
16
17namespace roc {
18namespace address {
19
20//! Parse socket address (host and port).
21//!
22//! @remarks
23//! The @p host string should be in one of the following forms:
24//! - "IPv4" e.g. "1.2.3.4"
25//! - "[IPv6]" e.g. "[::1]"
26//!
27//! @returns
28//! false if @p host can't be parsed.
29bool parse_socket_addr(const char* host, int port, SocketAddr& addr);
30
31} // namespace address
32} // namespace roc
33
34#endif // ROC_ADDRESS_PARSE_SOCKET_ADDR_H_
Socket address.
Definition: socket_addr.h:25
bool parse_socket_addr(const char *host, int port, SocketAddr &addr)
Parse socket address (host and port).
Root namespace.
Socket address.