[#CService-2constructor-045]
= xref:CService.adoc[CService]::CService
:relfileprefix: ../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;netaddress&period;h&gt;`

Construct an unspecified, invalid service&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CService/2constructor-06.adoc[CService]();
----

[.small]#xref:CService/2constructor-06.adoc[_» more&period;&period;&period;_]#

Construct a service from an IPv4 socket address&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:CService/2constructor-041.adoc[CService](sockaddr&lowbar;in const& addr);
----

[.small]#xref:CService/2constructor-041.adoc[_» more&period;&period;&period;_]#

Construct a service from an IPv6 socket address&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:CService/2constructor-0d.adoc[CService](sockaddr&lowbar;in6 const& addr);
----

[.small]#xref:CService/2constructor-0d.adoc[_» more&period;&period;&period;_]#

Construct a service from a network address and port&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CService/2constructor-0a.adoc[CService](
    xref:CNetAddr.adoc[CNetAddr] const& ip,
    uint16&lowbar;t port);
----

[.small]#xref:CService/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Construct a service from an IPv6 address and port&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CService/2constructor-0f.adoc[CService](
    in6&lowbar;addr const& ipv6Addr,
    uint16&lowbar;t port);
----

[.small]#xref:CService/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Construct a service from an IPv4 address and port&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CService/2constructor-0e.adoc[CService](
    in&lowbar;addr const& ipv4Addr,
    uint16&lowbar;t port);
----

[.small]#xref:CService/2constructor-0e.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *addr*
| The IPv4 socket address to read the address and port from&period;
| *ip*
| The network address of the service&period;
| *port*
| The TCP port in host byte order&period;
| *ipv6Addr*
| The IPv6 address of the service&period;
| *ipv4Addr*
| The IPv4 address of the service&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
