---
name: "dnet_conn"
section: "3"
platform: "linux"
package: "libdnet-dev"
version: "2.65+b1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dnet_conn"
---

# dnet\_conn(3)

Connect to remote DECnet object by name.

## NAME

dnet\_conn - Connect to remote DECnet object by name.

## SYNOPSIS

**#include \<netdnet/dn.h\>**\
 **#include \<netdnet/dnetdb.h\>**\

**int dnet\_conn (char \*hostname, char \*objname, int type, int,int,int,int)**

## DESCRIPTION

**dnet\_conn** connects to the remote object  **objname** in host **hostname** using the protocol denoted by **type** usually DNPROTO\_NSP. If successful, returns an integer file descriptor, else return errno.

## EXAMPLE

```
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>
main(void)
{
    int sockfd;
    sockfd=dnet_conn("mv3100","X$X0",DNPROTO_NSP,0,0,0,0);
    if (sockfd < 0)
    	printf ("Error connecting to remote object X$X0 on node mv3100");
    else
    {
    	printf ("Succesfully connected to remote object X$X0 on node mv3100");
    	close (sockfd);
     }
}
```

## SEE ALSO

[**dnet\_addr**(3)](/dnet_addr/3.md), [**dnet\_htoa**(3)](/dnet_htoa/3.md), [**dnet\_ntoa**(3)](/dnet_ntoa/3.md), [**getnodeadd**(3)](/getnodeadd/3.md), [**getnodebyname**(3)](/getnodebyname/3.md), [**getnodebyaddr**(3)](/getnodebyaddr/3.md), [**setnodeent**(3)](/setnodeent/3.md)
