0MQ end-to-end test works!

This commit is contained in:
Oran Juice 2015-01-24 16:43:33 +05:30
parent 9b850f28de
commit 3fba3fec57
No known key found for this signature in database
GPG Key ID: 71C5AF46CCB28124
3 changed files with 18 additions and 14 deletions

View File

@ -56,7 +56,7 @@ typedef enum {
start_ok_event = 16, start_ok_event = 16,
stop_ok_event = 17, stop_ok_event = 17,
close_ok_event = 18, close_ok_event = 18,
connection_pong_event = 19, ping_ok_event = 19,
error_event = 20, error_event = 20,
command_invalid_event = 21, command_invalid_event = 21,
other_event = 22 other_event = 22
@ -102,7 +102,7 @@ s_event_name [] = {
"START_OK", "START_OK",
"STOP_OK", "STOP_OK",
"CLOSE_OK", "CLOSE_OK",
"connection_pong", "PING_OK",
"ERROR", "ERROR",
"command_invalid", "command_invalid",
"other" "other"
@ -407,6 +407,9 @@ s_protocol_event (s_client_t *self, wap_proto_t *message)
case WAP_PROTO_CLOSE_OK: case WAP_PROTO_CLOSE_OK:
return close_ok_event; return close_ok_event;
break; break;
case WAP_PROTO_PING_OK:
return ping_ok_event;
break;
case WAP_PROTO_ERROR: case WAP_PROTO_ERROR:
return error_event; return error_event;
break; break;
@ -525,7 +528,7 @@ s_client_execute (s_client_t *self, event_t event)
} }
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -668,7 +671,7 @@ s_client_execute (s_client_t *self, event_t event)
} }
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -698,7 +701,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -728,7 +731,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -758,7 +761,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -788,7 +791,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -818,7 +821,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -848,7 +851,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -897,7 +900,7 @@ s_client_execute (s_client_t *self, event_t event)
} }
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -916,7 +919,7 @@ s_client_execute (s_client_t *self, event_t event)
break; break;
case defaults_state: case defaults_state:
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {
@ -987,7 +990,7 @@ s_client_execute (s_client_t *self, event_t event)
self->state = connected_state; self->state = connected_state;
} }
else else
if (self->event == connection_pong_event) { if (self->event == ping_ok_event) {
} }
else else
if (self->event == error_event) { if (self->event == error_event) {

View File

@ -90,6 +90,7 @@ namespace tools
// TODO: Daemon not up. // TODO: Daemon not up.
} }
int rc = wap_client_start (client, 25); int rc = wap_client_start (client, 25);
std::cout << "\n\n Response: " << (int)wap_client_curr_height(client) << std::endl;
assert (rc == 0); assert (rc == 0);
}; };
struct transfer_details struct transfer_details