brotorift 0.3.5 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3a6bc71f0a335b6ac8945a9211bfdb26127ace4416b67afd4b1b61404ac14d9
|
4
|
+
data.tar.gz: ec535b169b1173ae74018ae2a40a67a56bedc256db8b5233e5e2a67c8c8ec1d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17b79c96de8f98c7e48a1faa0e34502fb2e22dabd59e3af62ddfbac7a03c5382974e1f3eee37a9bc40a03a391c21be161ce24e12ee77577d6fa0e0da653cc910
|
7
|
+
data.tar.gz: 31378d699b2840197fbf35f7529280291e6994512941fc6b3d9165ac393a59d1807f869de722fd78f975aacc82985cf971c7c67e6034fca9dfd92257cbddc7f0
|
@@ -102,12 +102,16 @@ defmodule <%= node.namespace %>.<%= node.elixir_connection %> do
|
|
102
102
|
{:ok, state}
|
103
103
|
end
|
104
104
|
defp process_packet(data, handler, state) do
|
105
|
-
<<
|
105
|
+
<<header::32-little, data::binary>> = data
|
106
106
|
case header do<% for m in n.in_direction.messages.values %>
|
107
107
|
<%= m.elixir_header_name %> -><% for p in m.members %>
|
108
108
|
{data, <%= p.elixir_name %>} = <%= p.type.elixir_read node %><% end %>
|
109
|
-
|
110
|
-
|
109
|
+
if byte_size(data) != 0 do
|
110
|
+
stop(self())
|
111
|
+
else
|
112
|
+
{:ok, state} = handler.<%= m.elixir_name %>(self(), state<%= m.elixir_params %>)
|
113
|
+
process_packet(data, handler, state)<% end %>
|
114
|
+
end
|
111
115
|
end
|
112
116
|
end
|
113
117
|
end
|
@@ -66,9 +66,10 @@ namespace <%= node.namespace %>
|
|
66
66
|
|
67
67
|
public PacketProcessPolicy policy { get; set; }
|
68
68
|
|
69
|
-
public <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler )
|
69
|
+
public <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler, long dataHead )
|
70
70
|
{
|
71
71
|
this.handler = handler;
|
72
|
+
this.dataHead = dataHead;
|
72
73
|
this.policy = PacketProcessPolicy.Discard;
|
73
74
|
}
|
74
75
|
|