Skip to content

Add examples to Socket::Server#accept API docs#6705

Merged
RX14 merged 2 commits intocrystal-lang:masterfrom
straight-shoota:jm/docs/socket_server-accept
Sep 12, 2018
Merged

Add examples to Socket::Server#accept API docs#6705
RX14 merged 2 commits intocrystal-lang:masterfrom
straight-shoota:jm/docs/socket_server-accept

Conversation

@straight-shoota
Copy link
Copy Markdown
Member

No description provided.

# require "socket"
#
# server = TCPServer.new(2202)
# while socket = server.accept
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accept -> accept?

# require "socket"
#
# server = TCPServer.new(2202)
# while socket = server.accept
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But server.accept is always truthy...

# require "socket"
#
# server = TCPServer.new(2202)
# while true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loop do?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are fine. I'm fact, I'm starting to think we should remove loop, it adds absolutely nothing and it's just another way of doing something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I guess it was useful when it had its block argument :P

@RX14 RX14 merged commit 390e3b0 into crystal-lang:master Sep 12, 2018
@RX14 RX14 added this to the 0.27.0 milestone Sep 12, 2018
@straight-shoota straight-shoota deleted the jm/docs/socket_server-accept branch September 12, 2018 16:33
ezrast pushed a commit to ezrast/crystal that referenced this pull request Oct 2, 2018
* Add examples to Socket::Server#accept

* fixup! Add examples to Socket::Server#accept
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants