flambard / enet Goto Github PK
View Code? Open in Web Editor NEWENet implementation in Erlang/OTP
License: Apache License 2.0
ENet implementation in Erlang/OTP
License: Apache License 2.0
it looks like only the first coming client is served. The second client is only able to successfully connect after the other connection was terminated.
Do you play to license that work under some open source licence?
Not doing so have some law implications - https://help.github.com/articles/open-source-licensing/#what-happens-if-i-dont-choose-a-license
Could you make some docs?
Or maybe expand test so it will set up some listener and send packet to it.
gen_udp opens two times, the first time here:
Line 32 in 5a493ff
Line 112 in 5a493ff
handle_info
, because Socket in State and Socket in the message disagrees:Lines 205 to 209 in 5a493ff
I think it's because of this option reuseaddr
:
Line 52 in 5a493ff
After an attempt to fix #6 I tried to run the tests after a change, but all the tests fail:
~/mana/enet $ rebar3 eunit
===> Verifying dependencies...
===> Fetching proper ({pkg,<<"proper">>,<<"1.2.0">>})
===> Version cached at /home/ablu/.cache/rebar3/hex/default/packages/proper-1.2.0.tar is up to date, reusing it
===> Fetching gproc ({pkg,<<"gproc">>,<<"0.8.0">>})
===> Version cached at /home/ablu/.cache/rebar3/hex/default/packages/gproc-0.8.0.tar is up to date, reusing it
===> Linking _build/default/lib/gproc to _build/test/lib/gproc
===> Compiling proper
make: 'include/compile_flags.hrl' is up to date.
/home/ablu/mana/enet/_build/test/lib/proper/src/proper_typeserver.erl:553: Warning: erlang:get_stacktrace/0 used following a 'try' expression may stop working in a future release. (Use it inside 'try'.)
/home/ablu/mana/enet/_build/test/lib/proper/src/proper_typeserver.erl:556: Warning: erlang:get_stacktrace/0 used following a 'try' expression may stop working in a future release. (Use it inside 'try'.)
_build/test/lib/proper/src/proper_typeserver.erl:553: Warning: erlang:get_stacktrace/0 used following a 'try' expression may stop working in a future release. (Use it inside 'try'.)
_build/test/lib/proper/src/proper_typeserver.erl:556: Warning: erlang:get_stacktrace/0 used following a 'try' expression may stop working in a future release. (Use it inside 'try'.)
===> Compiling gproc
_build/default/lib/gproc/src/gproc_dist.erl:25: Warning: behaviour gen_leader undefined
===> Compiling enet
_build/test/lib/enet/test/enet_model.erl:340: Warning: function busy_host_port/1 is unused
_build/test/lib/enet/test/enet_model.erl:355: Warning: function peer_pid/1 is unused
_build/test/lib/enet/test/enet_model.erl:360: Warning: function connect_id/1 is unused
_build/test/lib/enet/test/enet_model.erl:379: Warning: function local_ip/0 is unused
===> Performing EUnit tests...
FFFFFFFFFFFFFF
Failures:
1) enet_tests:local_zero_peer_limit_test/0
Failure/Error: {exit,
{noproc,
{gen_server,call,
[enet_sup,
{start_child,
#{id => 5001,
modules => [enet_host_sup],
restart => temporary,
shutdown => infinity,
start => {enet_host_sup,start_link,[]},
type => supervisor}},
infinity]}},
[{gen_server,call,3,
[{file,"gen_server.erl"},{line,214}]},
{enet,start_host,2,
[{file,
"/home/ablu/mana/enet/_build/test/lib/enet/src/enet.erl"},
{line,22}]},
{enet_tests,local_zero_peer_limit_test,0,
[{file,
"/home/ablu/mana/enet/_build/test/lib/enet/src/enet_tests.erl"},
{line,8}]}]}
Output:
The other errors seem to be the same / similar... But this is unrelated to my changes (it happens on clean master)
Any idea where I would start?
Imagining use for godot's future DTLS code.
Hi! I have a question/issue about what happens when out-of-order reliable packets come in.
I see here https://github.com/flambard/enet/blob/master/src/enet_channel.erl#L147-L150
That you have the following:
{recv_reliable, {
#command_header{ reliable_sequence_number = N },
C = #reliable{}
}} when N =:= S#state.incoming_reliable_sequence_number ->
It seems to me that this is only matching a packet if the packet's sequence number matches the expected incoming_reliable_sequence_number
in your state record.
What happens if the packet comes out of order? I have the impression from the ENet docs[1] that the server is responsible for buffering packets until the wanted next packet comes in. E.g, if I send packets [1-10] from the client, and the next packet the server receives is packet 12, then it should buffer packet 12 and wait to deliver it until after packet 11 arrives from the client.
The reason I'm asking is because I think I've seen some crashes related to this, but I'm not 100% sure. I would be happy to help take a stab at fixing it, though, if you agree that it is a problem.
[1] http://enet.bespin.org/Features.html
Relevant lines:
For reliable packets, if a higher sequence number packet arrives, but the preceding packets in the sequence have not yet arrived, ENet will stall delivery of the higher sequence number packets until its predecessors have arrived.
Hi,
I wonder, is this library compatible / tested against the C based enet implementation?
To me it looks like the Compressed
and SentTimeIncluded
bits are swapped compared to the official enet. But even after changing that I run into issues with the command parsing...
Regards,
Ablu
If multiple clients are connected it is not possible to tell from which one the message was received. Only the channel id is sent:
Line 142 in 94fcb7f
But since the channel id might be the same for all / multiple clients this does not allow a reply.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.