MPD: net/Resolver.hxx File Reference

MPD 0.20.15

Functions
Resolver.hxx File Reference
`#include "check.h"`
`#include "Compiler.h"`
Include dependency graph for Resolver.hxx:

Go to the source code of this file.

## Functions
addrinfo * | resolve_host_port (const char *host_port, unsigned default_port, int flags, int socktype)
| Resolve a specification in the form "host", "host:port", "[host]:port". More...

## Function Documentation

## ◆ resolve_host_port()

addrinfo* resolve_host_port | ( | const char * | host_port,
|  | unsigned | default_port,
|  | int | flags,
|  | int | socktype
| ) |  |

Resolve a specification in the form "host", "host:port", "[host]:port".

This is a convenience wrapper for getaddrinfo().

Throws #std::runtime_error on error.

Parameters

  default_port | a default port number that will be used if none is given in the string (if applicable); pass 0 to go without a default

Returns
  an #addrinfo linked list that must be freed with freeaddrinfo()