- Data_Get_Struct(task, m_task_t, tk);
- int res = MSG_task_send(tk,RSTRING(mailbox)->ptr);
-
- if(res != MSG_OK)
- rb_raise(rb_eRuntimeError,"MSG_task_send failed");
-
- return;
-}
-
-// Recieving Task
-
-/**
-*It Return a Task
-*/
-
-static VALUE task_receive(VALUE class,VALUE mailbox)
-{
- m_task_t tk;
- MSG_task_receive(tk,RSTRING(mailbox)->ptr);
- return Data_Wrap_Struct(class, 0, task_free, tk);
+ Data_Get_Struct(task, s_m_task_t, tk);
+ INFO1("Sending task %p",tk);
+ rv = MSG_task_send(tk,RSTRING(mailbox)->ptr);
+ if(rv != MSG_OK)
+ {
+ if (rv == MSG_TRANSFER_FAILURE )
+ rb_raise(rb_eRuntimeError,"Transfer failure while Sending");
+ else if ( rv == MSG_HOST_FAILURE )
+ rb_raise(rb_eRuntimeError,"Host failure while Sending");
+ else if ( rv == MSG_TIMEOUT_FAILURE )
+ rb_raise(rb_eRuntimeError,"Timeout failure while Sending");
+ else
+ rb_raise(rb_eRuntimeError,"MSG_task_send failed");
+ }