DNET_CONN(3)

πŸ“¦ version 2.65build2, in ubuntu jammy

πŸ’– 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 🌈

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