Sfoglia il codice sorgente

Be sure to enable writing in the worker->dpnode connection

Ian Goldberg 14 anni fa
parent
commit
53b775f223
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      worker.cc

+ 2 - 0
worker.cc

@@ -70,6 +70,7 @@ bool dpcallback(void *cbdata, unsigned short threadId,
     memmove(DPbuf+(WORDS+3)*sizeof(unsigned int), &b_0, sizeof(unsigned int));
     memmove(DPbuf+(WORDS+3)*sizeof(unsigned int), &b_0, sizeof(unsigned int));
     memmove(DPbuf+(WORDS+4)*sizeof(unsigned int), &b_1, sizeof(unsigned int));
     memmove(DPbuf+(WORDS+4)*sizeof(unsigned int), &b_1, sizeof(unsigned int));
     memmove(DPbuf+(WORDS+5)*sizeof(unsigned int), &b_2, sizeof(unsigned int));
     memmove(DPbuf+(WORDS+5)*sizeof(unsigned int), &b_2, sizeof(unsigned int));
+
     bufferevent_write(bev, DPbuf, (WORDS+6)*sizeof(unsigned int));
     bufferevent_write(bev, DPbuf, (WORDS+6)*sizeof(unsigned int));
 
 
     // If worker_thread_state changes to WT_SHOULD_STOP, then signal to
     // If worker_thread_state changes to WT_SHOULD_STOP, then signal to
@@ -133,6 +134,7 @@ static void dpconn_event_cb(struct bufferevent *bev, short events,
 {
 {
     if (events & BEV_EVENT_CONNECTED) {
     if (events & BEV_EVENT_CONNECTED) {
 	// We have successfully connected to the dpnode
 	// We have successfully connected to the dpnode
+	bufferevent_enable(bev, EV_WRITE);
 	++wrkctrlstate.num_connected_dpnodes;
 	++wrkctrlstate.num_connected_dpnodes;
 	if (wrkctrlstate.num_connected_dpnodes ==
 	if (wrkctrlstate.num_connected_dpnodes ==
 		wrkctrlstate.num_expected_dpnodes) {
 		wrkctrlstate.num_expected_dpnodes) {