2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

isc_socket_create() API update

This commit is contained in:
Bob Halley 1999-07-15 20:18:43 +00:00
parent 6e9eb94521
commit eb5670c09e
3 changed files with 8 additions and 4 deletions

View File

@ -117,7 +117,8 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
* Open a UDP socket.
*/
ifp->udpsocket = NULL;
iresult = isc_socket_create(mgr->socketmgr, isc_sockettype_udp,
iresult = isc_socket_create(mgr->socketmgr, PF_INET,
isc_sockettype_udp,
&ifp->udpsocket);
if (iresult != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
@ -147,7 +148,8 @@ ns_interface_create(ns_interfacemgr_t *mgr, isc_sockaddr_t *addr,
* Open a TCP socket.
*/
ifp->tcpsocket = NULL;
iresult = isc_socket_create(mgr->socketmgr, isc_sockettype_tcp,
iresult = isc_socket_create(mgr->socketmgr, PF_INET,
isc_sockettype_tcp,
&ifp->tcpsocket);
if (iresult != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,

View File

@ -384,7 +384,8 @@ main(int argc, char *argv[])
sockaddr.type.sin.sin_family = AF_INET;
sockaddr.type.sin.sin_port = htons(5555);
sockaddr.length = sizeof (struct sockaddr_in);
RUNTIME_CHECK(isc_socket_create(socketmgr, isc_sockettype_tcp, &s0) ==
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET,
isc_sockettype_tcp, &s0) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_listen(s0, 0) == ISC_R_SUCCESS);

View File

@ -354,7 +354,8 @@ main(int argc, char *argv[])
sockaddr.type.sin.sin_family = AF_INET;
sockaddr.type.sin.sin_port = htons(5555);
sockaddr.length = sizeof (struct sockaddr_in);
RUNTIME_CHECK(isc_socket_create(socketmgr, isc_sockettype_udp, &s0) ==
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET,
isc_sockettype_udp, &s0) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_bind(s0, &sockaddr) == ISC_R_SUCCESS);