Add TestServer.TCP#58
Draft
richard-ash wants to merge 1 commit into
Draft
Conversation
dc7e815 to
c76044f
Compare
ed38120 to
75c5759
Compare
75c5759 to
4e3d05e
Compare
Comment on lines
+174
to
+175
| @spec connect() :: {:ok, connection()} | ||
| def connect, do: connect([]) |
Owner
There was a problem hiding this comment.
Connect is not really a good name as it implies that it connects to something when you call it. It should be something like init or similar, or connection if we want to keep it close to that terminology.
Owner
There was a problem hiding this comment.
Actually, does it even make sense to make this expectation? Wouldn't you just do separate instances for this?
| defp accept_loop(instance, listen_socket) do | ||
| case :gen_tcp.accept(listen_socket) do | ||
| {:ok, socket} -> | ||
| pid = spawn_link(fn -> wait_for_socket(instance) end) |
Owner
There was a problem hiding this comment.
We can just call it the same so e.g. we do bind(instance) and then bind(instance, socket), it's the same thing. It could also be inlined here since it's so minimal and kinda belongs, the bind(intance) function is really not doing anything.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.