| | 1048 | # |
|---|
| | 1049 | # Changed 27Dec07: Eliminated the hookable error handling. |
|---|
| | 1050 | # No one was using it, and it degraded performance significantly. |
|---|
| | 1051 | # It's in original_event_callback, which is dead code. |
|---|
| | 1052 | # |
|---|
| | 1053 | if opcode == ConnectionData |
|---|
| | 1054 | c = @conns[conn_binding] or raise ConnectionNotBound |
|---|
| | 1055 | c.receive_data data |
|---|
| | 1056 | elsif opcode == ConnectionUnbound |
|---|
| | 1057 | if c = @conns.delete( conn_binding ) |
|---|
| | 1058 | c.unbind |
|---|
| | 1059 | elsif c = @acceptors.delete( conn_binding ) |
|---|
| | 1060 | # no-op |
|---|
| | 1061 | else |
|---|
| | 1062 | raise ConnectionNotBound |
|---|
| | 1063 | end |
|---|
| | 1064 | elsif opcode == ConnectionAccepted |
|---|
| | 1065 | accep,args,blk = @acceptors[conn_binding] |
|---|
| | 1066 | raise NoHandlerForAcceptedConnection unless accep |
|---|
| | 1067 | c = accep.new data, *args |
|---|
| | 1068 | @conns[data] = c |
|---|
| | 1069 | blk and blk.call(c) |
|---|
| | 1070 | c # (needed?) |
|---|
| | 1071 | elsif opcode == TimerFired |
|---|
| | 1072 | t = @timers.delete( data ) or raise UnknownTimerFired |
|---|
| | 1073 | t.call |
|---|
| | 1074 | elsif opcode == ConnectionCompleted |
|---|
| | 1075 | c = @conns[conn_binding] or raise ConnectionNotBound |
|---|
| | 1076 | c.connection_completed |
|---|
| | 1077 | elsif opcode == LoopbreakSignalled |
|---|
| | 1078 | run_deferred_callbacks |
|---|
| | 1079 | end |
|---|
| | 1080 | end |
|---|
| | 1081 | |
|---|
| | 1082 | private |
|---|
| | 1083 | def EventMachine::original_event_callback conn_binding, opcode, data |
|---|