Edit

kc3-lang/fnet

Branch :

  • Show log

    Commit

  • Author : skullchap
    Date : 2025-03-14 21:56:23
    Hash : 79d4538f
    Message : examples: udp broadcast chat

  • Properties
  • Git HTTP https://git.kmx.io/kc3-lang/fnet.git
    Git SSH git@git.kmx.io:kc3-lang/fnet.git
    Public ? true
    Name
    Description

    Forked from https://github.com/skullchap/fnet

    Users
    -
    +
    thodg git_deploy kc3_lang_org thodg_l thodg_m thodg_w www_kmx_io
    Tags

  • README.md
  • fnet - FILE* over your socks.

    Create, send and receive data over your tcp, udp and unix sockets with familiar C standard library FILE* IO interface.

    NetConn *c = fnetdial("tcp", "127.0.0.1:9999");
    fprintf(fnetf(c), "hello!\n");
    

    Dial/Listen should be familiar to Plan9'ers and Gophers.

    NetConn*	fnetdial(char *proto, char *addr);
    NetConn*	fnetlisten(char *proto, char *addr);
    NetConn*	fnetaccept(NetConn*);
    char*		fneterr(void);
    FILE*		fnetf(NetConn*);
    char*		fnetlocaddr(NetConn*);
    char*		fnetremaddr(NetConn*);
    void		fnetclose(NetConn*);
    

    Check examples of dialing and listening.

    cd examples/
    ./compile dial && ./compile listen
    # ./listen tcp 127.0.0.1:9999 # ./dial tcp 127.0.0.1:9999
    

    License

    MIT