Permalink
Browse files

Simplified terminate state in client

  • Loading branch information...
1 parent eadd124 commit a304ed8a5e0d3584491202af3ae45c9f861b284e @hintjens hintjens committed Jan 3, 2013
Showing with 8 additions and 26 deletions.
  1. +0 −8 model/fmq_client.xml
  2. +8 −12 model/fmq_client_fsm.xml
  3. +0 −6 scripts/client_c.gsl
@@ -146,10 +146,6 @@ puts ("E: server claims we sent an invalid message");
puts ("E: protocol error");
</action>
-<action name = "terminate the server">
-server->next_event = terminate_event;
-</action>
-
<!-- Must happen before any connects -->
<method name = "subscribe">
<argument name = "path" type = "string" />
@@ -169,10 +165,6 @@ assert (*path == '/');
char *inbox = fmq_config_resolve (self->config, "client/inbox", ".inbox");
self->sub = sub_new (self, inbox, path);
zlist_append (self->subs, self->sub);
-
-<!-- disabled subscription after connect -->
-<!-- if (server->connected) -->
-<!-- server->next_event = subscribe_event; -->
</method>
<method name = "set inbox">
@@ -36,29 +36,25 @@
<event name = "HUGZ">
<action name = "send" message = "HUGZ-OK" />
</event>
- <!-- Subscription after connection not supported anymore
- <event name = "subscribe">
- <action name = "format icanhaz command" />
- <action name = "send" message = "ICANHAZ" />
- </event>
- -->
<event name = "send credit">
<action name = "send" message = "NOM" />
</event>
<event name = "ICANHAZ-OK" />
</state>
<state name = "defaults">
- <event name = "SRSLY" next = "start">
+ <event name = "SRSLY" next = "terminated">
<action name = "log access denied" />
- <action name = "terminate the server" />
</event>
- <event name = "RTFM">
+ <event name = "RTFM" next = "terminated">
<action name = "log invalid message" />
- <action name = "terminate the server" />
</event>
- <event name = "$other">
+ <event name = "$other" next = "terminated">
<action name = "log protocol error" />
- <action name = "terminate the server" />
</event>
</state>
+
+<!-- Ignore everything -->
+<state name = "terminated">
+ <event name = "$other" />
+</state>
@@ -283,7 +283,6 @@ typedef enum {
} state_t;
typedef enum {
- terminate_event = -1,
.for class.event
$(name:c)_event = $(index ())$(last ()??"" ?",")
.endfor
@@ -647,11 +646,6 @@ client_server_execute (client_t *self, server_t *server, int event)
.if switches.animate ?= 1
zclock_log ("C: -------------------> %s", s_state_name [server->state]);
.endif
- if (server->next_event == terminate_event) {
- // Automatically calls server_destroy
- // reset state machine
- break;
- }
}
}

0 comments on commit a304ed8

Please sign in to comment.