Asynchronous read

38 views
Skip to first unread message

tejuka...@gmail.com

unread,
Mar 24, 2015, 6:47:38 AM3/24/15
to libi...@googlegroups.com
Hey..

Does libiscsi have any function for asynchronous read ? 

Thanks!

ronnie sahlberg

unread,
Mar 24, 2015, 4:30:17 PM3/24/15
to libi...@googlegroups.com
Hi Tejasvini,

Yes, libiscsi is primarily a non-blocking async library and all
commands exist in async versions.
(There is also a synchronous version of the API but that is maerely
for ease of use in trivial applications. Real stuff use the async
interface)

For example:

EXTERN struct scsi_task *
iscsi_read16_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
uint32_t datalen, int blocksize,
int rdprotect, int dpo, int fua, int fua_nv, int
group_number,
iscsi_command_cb cb, void *private_data);

Check iscsi.h All the functions ending in _task() are async.

You then use the functions iscsi_get_fd(), iscsi_which_events() and
iscsi_service() to plug libiscsi into your event loop.



regards
ronnie sahlberg
> --
> You received this message because you are subscribed to the Google Groups
> "libiscsi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to libiscsi+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages