DNET_CONN(3)
π DNET_CONN β ok bestie, let's talk about dnet_conn(3) π
from the Library Functions Manual, section 3, iykyk π
β¨ NAME β¨
dnet_conn β connect to a remote DECnet object by name. yes that's the whole vibe. it connects. to objects. by name. π
πΈ SYNOPSIS πΈ
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
int dnet_conn (char *hostname, char *objname, int type, int,int,int,int)
bestie. look at those last four ints. they don't even have names. they're just there. we love a mysterious king π
π¦ DESCRIPTION π¦
okay so here's the tea, dnet_conn connects to the remote object objname sitting on the host hostname, using the protocol you pass in as type β and usually that's DNPROTO_NSP π«Ά
and if it goes well?? if it ATE?? it returns an integer file descriptor for you to play with β¨
and if it does NOT go well, it returns errno. no cap. that's the error situation right there π
π₯ EXAMPLE π₯
here's a whole little main character moment, copy it, love it, run it:
#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);
}
}
connecting to X$X0 on mv3100 with DNPROTO_NSP and four lil zeros, and then closing the fd like a responsible icon π (also yes, the original example spells it "Succesfully" β we keep it exactly as-is, we don't fix the queen's typos π)
π SEE ALSO π
dnet_addr(3)dnet_htoa(3)dnet_ntoa(3)getnodeadd(3)getnodebyname(3)getnodebyaddr(3)setnodeent(3)
go read those too bestie, they're all in the same friend group π«Άβ¨
that's the whole page!! this one's from the DECnet database functions, dated July 28, 1998, and it lives at DNET_CONN(3) β periodt π ππ
π¦ where this page comes from
- ubuntu jammy: libdnet-dev 2.65build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms