Add iscsi_tcp_set_user_timeout function
This patch adds a user configurable option to set the TCP_USER_TIMEOUT socket option. With this timeout set a broken TCP session is shutdown after a given timeout even there are unacked packets. SO_KEEPALIVE seems not to work in this case.
This commit is contained in:
@@ -84,6 +84,8 @@ struct iscsi_context {
|
||||
|
||||
int fd;
|
||||
int is_connected;
|
||||
|
||||
int tcp_user_timeout;
|
||||
|
||||
int current_phase;
|
||||
int next_phase;
|
||||
|
||||
@@ -967,6 +967,13 @@ iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi);
|
||||
EXTERN void
|
||||
iscsi_set_debug(struct iscsi_context *iscsi, int level);
|
||||
|
||||
/*
|
||||
* This function is to set the TCP_USER_TIMEOUT option. It has to be called after iscsi
|
||||
* context creation. The value given in ms is then applied each time a new socket is created.
|
||||
*/
|
||||
EXTERN void
|
||||
iscsi_set_tcp_user_timeout(struct iscsi_context *iscsi, int timeout_ms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user