@@ -1014,6 +1014,17 @@ static VALUE rb_trilogy_closed(VALUE self)
10141014 }
10151015}
10161016
1017+ static VALUE rb_trilogy_check (VALUE self )
1018+ {
1019+ struct trilogy_ctx * ctx = get_open_ctx (self );
1020+
1021+ int rc = trilogy_sock_check (ctx -> conn .socket );
1022+ if (rc != TRILOGY_OK && rc != TRILOGY_AGAIN ) {
1023+ handle_trilogy_error (ctx , rc , "trilogy_sock_check" );
1024+ }
1025+ return Qtrue ;
1026+ }
1027+
10171028static VALUE rb_trilogy_discard (VALUE self )
10181029{
10191030 struct trilogy_ctx * ctx = get_ctx (self );
@@ -1105,6 +1116,7 @@ RUBY_FUNC_EXPORTED void Init_cext()
11051116 rb_define_method (Trilogy , "escape" , rb_trilogy_escape , 1 );
11061117 rb_define_method (Trilogy , "close" , rb_trilogy_close , 0 );
11071118 rb_define_method (Trilogy , "closed?" , rb_trilogy_closed , 0 );
1119+ rb_define_method (Trilogy , "check" , rb_trilogy_check , 0 );
11081120 rb_define_method (Trilogy , "discard!" , rb_trilogy_discard , 0 );
11091121 rb_define_method (Trilogy , "last_insert_id" , rb_trilogy_last_insert_id , 0 );
11101122 rb_define_method (Trilogy , "affected_rows" , rb_trilogy_affected_rows , 0 );
0 commit comments