Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
gensio_se...ack_enable(3)  Library Functions Manual  gensio_se...ack_enable(3)

NAME
       gensio_set_read_callback_enable,	gensio_set_write_callback_enable - En-
       able or disable read data and write ready

SYNOPSIS
       #include	<gensio/gensio.h>

       void gensio_set_read_callback_enable(struct gensio *io,
			   bool	enabled);

       void gensio_set_write_callback_enable(struct gensio *io,
			   bool	enabled);

DESCRIPTION
       These  function	enable	the  write callback, or	the read callback, for
       gensios (and all	child gensios).	 Generally disabling the read callback
       will disable all	callbacks except write because it  won't  receive  any
       data to do any processing.

       After  you open a gensio	or receive a gensio from an accepter, the gen-
       sio has all the enables set to false.  You would	generally want to  en-
       able the	read callback and leave	it enabled as much as possible so that
       low-level  processing  will  happen on the gensio.  In particular, dis-
       abling read on a	UDP gensio will	disable	all read an accept processing.

       Enabling	the write callback will	enable the callback to tell you	if the
       gensio can currently write any data.  You normally want to  leave  this
       disabled	 and  enable it	if you write data and get a partial write.  Or
       even better, when you have data to write, enable	the write callback and
       write the data from the callback, disabling when	it is all written.

       Disabling the write callback does not necessarily keep data from	 being
       transmitted  by the gensio.  The	SSL gensio, for	instance, may transmit
       key information on a rekey, or other gensios may	transmit  flow-control
       information.  This only affects the write callback.

       Disabling  the  callbacks may not be immediate.	"Immediate" is hard to
       define in a SMP system, anyway.	There  may  be	callbacks  running  or
       about  to  be called when you disable the callback, they	may still run.
       You must	be prepared to handle these race conditions.

RETURN VALUES
       Zero is returned	on success, or a gensio	error on failure.

SEE ALSO
       gensio_err(3), gensio(5)

				  27 Feb 2019	     gensio_se...ack_enable(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=gensio_set_read_callback_enable&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help