int ei_reg_send_tmo(ei_cnode* ec, int fd, char *server_name, char* buf, int len, unsigned ms) { erlang_pid *self = ei_self(ec); self->num = fd; /* erl_errno and return code is set by ei_reg_send_encoded_tmo() */ return ei_send_reg_encoded_tmo(fd, self, server_name, buf, len, ms); }
/* Client send message (Erlang distribution protocol) */ static int oe_send_tmo(CORBA_Environment *env, unsigned int ms) { if (strlen(env->_regname) == 0) { if (ei_send_encoded_tmo(env->_fd, env->_to_pid, env->_outbuf, env->_iout, ms) < 0) { /* XXX Cannot send to peer? */ CORBA_exc_set(env, CORBA_SYSTEM_EXCEPTION, NO_RESPONSE, "Cannot connect to server"); return -1; } } else { if (ei_send_reg_encoded_tmo(env->_fd, env->_from_pid, env->_regname, env->_outbuf, env->_iout, ms) < 0) { /* XXX Cannot send to peer? */ CORBA_exc_set(env, CORBA_SYSTEM_EXCEPTION, NO_RESPONSE, "Cannot connect to server"); return -1; } } return 0; }
int ei_send_reg_encoded(int fd, const erlang_pid *from, const char *to, char *msg, int msglen) { return ei_send_reg_encoded_tmo(fd, from, to, msg, msglen, 0); }