libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

Ixp9Srv.3 (2318B)


      1 .TH "IXP9SRV" 3 "2010 Jun" "libixp Manual"
      2 
      3 .SH NAME
      4 .P
      5 Ixp9Srv, Ixp9Req, ixp_serve9conn
      6 
      7 .SH SYNOPSIS
      8 .nf
      9   #include <ixp.h>
     10   
     11   typedef struct Ixp9Srv Ixp9Srv;
     12   struct Ixp9Srv {
     13           void* aux;
     14           void (*attach)(Ixp9Req*);
     15           void (*clunk)(Ixp9Req*);
     16           void (*create)(Ixp9Req*);
     17           void (*flush)(Ixp9Req*);
     18           void (*open)(Ixp9Req*);
     19           void (*read)(Ixp9Req*);
     20           void (*remove)(Ixp9Req*);
     21           void (*stat)(Ixp9Req*);
     22           void (*walk)(Ixp9Req*);
     23           void (*write)(Ixp9Req*);
     24           void (*wstat)(Ixp9Req*);
     25           void (*freefid)(IxpFid*);
     26   }
     27   
     28   typedef struct Ixp9Req Ixp9Req;
     29   struct Ixp9Req {
     30           Ixp9Srv*        srv;
     31           IxpFid*         fid;    /* Fid structure corresponding to IxpFHdr.fid */
     32           IxpFid*         newfid; /* Corresponds to IxpFTWStat.newfid */
     33           Ixp9Req*        oldreq; /* For TFlush requests, the original request. */
     34           IxpFcall        ifcall; /* The incoming request fcall. */
     35           IxpFcall        ofcall; /* The response fcall, to be filled by handler. */
     36           void*           aux;    /* Arbitrary pointer, to be used by handlers. */
     37   
     38           /* Private members */
     39           ...
     40   }
     41   
     42   void ixp_serve9conn(IxpConn *c);
     43 .fi
     44 
     45 .SH DESCRIPTION
     46 .P
     47 The ixp_serve9conn handles incoming 9P connections. It is
     48 ordinarily passed as the IreadR member to \fBixp_listen(3)\fR with an
     49 Ixp9Srv structure passed as the IauxR member. The handlers
     50 defined in the Ixp9Srv structure are called whenever a matching
     51 Fcall type is received. The handlers are expected to call
     52 \fBixp_respond(3)\fR at some point, whether before they return or at
     53 some undefined point in the future. Whenever a client
     54 disconnects, libixp generates whatever flush and clunk events are
     55 required to leave the connection in a clean state and waits for
     56 all responses before freeing the connections associated data
     57 structures.
     58 
     59 .P
     60 Whenever a file is closed and an \fBIxpFid(3)\fR is about to be freed,
     61 the IfreefidR member is called to perform any necessary cleanup
     62 and to free any associated resources.
     63 
     64 .SH SEE ALSO
     65 .P
     66 ixp_listen(3), ixp_respond(3), ixp_printfcall(3),
     67 IxpFcall(3), IxpFid(3)
     68 
     69 
     70 .\" man code generated by txt2tags 2.5 (http://txt2tags.sf.net)
     71 .\" cmdline: txt2tags -o- Ixp9Srv.man3
     72