Ticket #38 (new enhancement)

Opened 11 months ago

Last modified 11 months ago

add examples for using the reactor from C++

Reported by: tmm1 Assigned to: raggi
Priority: minor Milestone: EventMachine "Framework"
Keywords: examples Cc: francis

Change History

06/28/08 22:18:24 changed by tmm1

--- ./ext/em.cpp	2008-06-17 14:40:07.000000000 -0700
+++ ./ext/em.cpp	2008-06-28 20:18:11.000000000 -0700
@@ -635,12 +635,14 @@
 _SelectDataSelect
 *****************/
 
+#ifdef BUILD_FOR_RUBY
 static VALUE _SelectDataSelect (void *v)
 {
 	SelectData_t *sd = (SelectData_t*)v;
 	sd->nSockets = select (sd->maxsocket+1, &(sd->fdreads), &(sd->fdwrites), NULL, &(sd->tv));
 	return Qnil;
 }
+#endif
 
 /*********************
 SelectData_t::_Select
@@ -648,6 +650,7 @@
 
 int SelectData_t::_Select()
 {
+	#ifdef BUILD_FOR_RUBY
 	#ifdef HAVE_TBR
 	rb_thread_blocking_region (_SelectDataSelect, (void*)this, RB_UBF_DFL, 0);
 	return nSockets;
@@ -656,6 +659,7 @@
 	#ifndef HAVE_TBR
 	return rb_thread_select (maxsocket+1, &fdreads, &fdwrites, NULL, &tv);
 	#endif
+	#endif
 }