File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,23 @@ def initialize(endpoint = nil, **options)
2020 @options = options
2121 end
2222
23+ # Called when a connection is established.
24+ # Override this method to perform setup when a connection is established.
25+ #
26+ # @parameter connection [Protocol::Connection] The established connection.
27+ protected def connected! ( connection )
28+ # Do nothing by default.
29+ end
30+
2331 # Accept incoming connections.
2432 # @yields {|connection| ...} Block called with each new connection.
25- def accept
33+ def accept ( & block )
2634 @endpoint . accept do |peer |
2735 connection = Protocol ::Connection . server ( peer , **@options )
2836
29- yield connection
37+ connected! ( connection , &block )
38+
39+ yield connection if block_given?
3040
3141 connection . run
3242 ensure
Original file line number Diff line number Diff line change 33## Unreleased
44
55 - Add support for multi-hop proxying.
6+ - Fix proxying of throw/catch value.
7+ - ` Client#run ` now takes a block.
8+ - ` Server#run ` delegates to ` Server#connected! ` .
69
710## v0.2.0
811
You can’t perform that action at this time.
0 commit comments