Comments (5)
The server is crashing with IOError, which is unhandled.
Try adding a rescue IOError here alongside EOFError:
https://github.com/celluloid/celluloid-io/blob/master/examples/echo_server.rb#L33
from celluloid-io.
Adding the rescue IOError
passes the tests and all the remaining connections stay open, but I'm curious why an IOError is raised in the first place. Writing an echo server using 'socket' and ruby threads doesn't raise an IOError when a socket connection is closed (only the client raises Errno::EPIPE, but nothing is raised on the server). Is this an issue coming from evented IO? Is there a better way to terminate the socket and associated fiber so that it doesn't raise?
from celluloid-io.
EOFError
, IOError
, Errno::ECONNRESET
, and Errno::EPIPE
are all exceptions that indicate a socket error. You might notice the many different ways that socket closure is detected on e.g. IRC servers.
echo_server.rb should probably reflect this, however, what I've been wanting to make is a more high-level abstraction for developing network servers which wraps up these concerns.
The reason why there's a multitude of potential exceptions is because Celluloid::IO tries to be a low-level wrapper which doesn't abstract away these concerns, as opposed to something like EventMachine which is a high-level wrapper that forces a particular programming paradigm onto developers.
from celluloid-io.
I'll close out the ticket then if it is executing as expected.
Were your thoughts on a higher level abstraction to create something similar to the level as EventMachine
or EventMachine::WebSocket
? Have you created a draft specification of what you're looking for from such an abstraction so that others could contribute towards the effort?
from celluloid-io.
On Wed, May 14, 2014 at 9:54 AM, cognitiveflux [email protected]:
Were your thoughts on a higher level abstraction to create something
similar to the level as EventMachine or EventMachine::WebSocket?With a completely different (synchronous) API, but perhaps similar ease of
useHave you created a draft specification of what you're looking for from
such an abstraction so that others could contribute towards the effort?I think the best approach would be an extraction from Reel (rewriting Reel
on top of it at the same time), namely Reel::Server::HTTP (as
Whatever::TCPServer), Reel::Server::SSL (as Whatever::SSLServer), and
Reel::Connection (as Whatever::Connection)
Tony Arcieri
from celluloid-io.
Related Issues (20)
- Test suite timeouts revamp.
- C::IO::TCPSocket.new dies with IO::EAGAINWaitReadable on JRuby v9.0.3.0. HOT 12
- [Feature request] Access to socket option within UDPSocket and TCPSocket HOT 3
- "it shouldn't crash" crashes HOT 2
- Celluloid::IO behaves like a Celluloid Actor failures HOT 24
- #wait_readable and #wait_writable have different signature than the ruby methods HOT 3
- bundle install fails, missing culture/sync
- Establishing a connection in TCPSocket is not happening asynchronously HOT 2
- server-side closing of an SSLSocket doesn't cause an event HOT 1
- Does it work with ruby 2.1, 2.2, 2.3? HOT 1
- Provide an actor-level select which can accept multiple sockets
- Rubinius crashes with IO::EINPROGRESSWaitWritable when opening Celluloid::IO::TCPSocket
- tests fail randomly (about 28% of times) HOT 2
- Not bundling with ruby < 2.2 HOT 6
- strange behavour with encoding bytes in examples HOT 2
- Review of net-http-celluloid-io gem modifications HOT 2
- Run celluloid backported mode.
- test fail of actor_spec
- help with server-side disconnects in slack-ruby-client HOT 6
- Resolv::ResolvError: DNS result has no information for ... under load HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from celluloid-io.