stropheruby 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
+ == 0.1.4 2010-02-26
2
+
3
+ * accessor of the connect_timeout in Connection class
4
+
1
5
  == 0.0.1 2008-12-05
2
6
 
3
- * 1 major enhancement:
7
+ * 1 major enhancement:
4
8
  * Initial release
data/ext/conn.c CHANGED
@@ -332,6 +332,24 @@ xmpp_ctx_t* xmpp_conn_get_context(xmpp_conn_t * const conn)
332
332
  return conn->ctx;
333
333
  }
334
334
 
335
+ /** Get the connect timeout bounded to the connection.
336
+ *
337
+ * @ingroup Connections
338
+ */
339
+ unsigned int xmpp_conn_get_connect_timeout(const xmpp_conn_t * const conn)
340
+ {
341
+ return conn->connect_timeout;
342
+ }
343
+
344
+ /** Set the connection's connect timeout
345
+ *
346
+ * @ingroup Connections
347
+ */
348
+ void xmpp_conn_set_connect_timeout(xmpp_conn_t * const conn, const unsigned int timeout)
349
+ {
350
+ conn->connect_timeout = timeout;
351
+ }
352
+
335
353
  /** Initiate a connection to the XMPP server.
336
354
  * This function returns immediately after starting the connection
337
355
  * process to the XMPP server, and notifiations of connection state changes
data/ext/strophe_ruby.c CHANGED
@@ -181,6 +181,22 @@ static VALUE t_xmpp_conn_set_pass(VALUE self, VALUE pass) {
181
181
  return pass;
182
182
  }
183
183
 
184
+ /* get the connect_timeout */
185
+ static VALUE t_xmpp_conn_get_connect_timeout(VALUE self)
186
+ {
187
+ xmpp_conn_t *conn;
188
+ Data_Get_Struct(self, xmpp_conn_t, conn);
189
+ return INT2FIX(xmpp_conn_get_connect_timeout(conn));
190
+ }
191
+
192
+ /* set the connect_timeout */
193
+ static VALUE t_xmpp_conn_set_connect_timeout(VALUE self, VALUE timeout)
194
+ {
195
+ xmpp_conn_t *conn;
196
+ Data_Get_Struct(self, xmpp_conn_t, conn);
197
+ xmpp_conn_set_connect_timeout(conn, FIX2INT(timeout));
198
+ return timeout;
199
+ }
184
200
 
185
201
  /* Parent handler for the connection... we call yield to invoke the client callback*/
186
202
  static void _conn_handler(xmpp_conn_t * const conn, const xmpp_conn_event_t status,
@@ -680,6 +696,8 @@ void Init_strophe_ruby() {
680
696
  rb_define_method(cConnection, "jid=", t_xmpp_conn_set_jid,1);
681
697
  rb_define_method(cConnection, "password", t_xmpp_conn_get_pass,0);
682
698
  rb_define_method(cConnection, "password=", t_xmpp_conn_set_pass,1);
699
+ rb_define_method(cConnection, "connect_timeout", t_xmpp_conn_get_connect_timeout,0);
700
+ rb_define_method(cConnection, "connect_timeout=", t_xmpp_conn_set_connect_timeout,1);
683
701
  rb_define_method(cConnection, "connect", t_xmpp_connect_client,0);
684
702
  rb_define_method(cConnection, "disconnect", t_xmpp_disconnect, 0);
685
703
  rb_define_method(cConnection, "send", t_xmpp_send, 1);
data/lib/strophe_ruby.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__))
2
2
 
3
3
  require 'strophe_ruby.so'
4
4
  module StropheRuby
5
- VERSION = '0.0.1'
5
+ VERSION = '0.1.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stropheruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Fran\xC3\xA7ois Lamontagne"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-06 00:00:00 -05:00
12
+ date: 2009-03-06 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency