-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't pass sockets into HttpServer #110
Comments
I gave it a thought and passing the socket is a valuable idea. By passing the sockets you can force HttpServer to use special sockets, for example SslSocket. I was just confused when creating an IrcClient class, because I just went with what I have already seen (socket in the constructor), but the IrcClient doesn't listen on any port, actually it has to connect to various other sources and recreate the socket if the connection fails or can't be completed. But still, IrcClients can use ssl and socks4 to communicate: One possible solution to solve this dilema is to make sockets reusable, what do you think myeisha? |
Yeah, no. The idea behind the current IO architecture was to have simple base functionality, and a pipeline that wraps more and more around it. For SSL, you'd hook into the pipeline at ClientConnected and wrap the stream in a TlsStream. Same or similar things work for other protocols. In the IRC example, you wouldn't even need that, because the IRC client would be happy with only a stream it can work with. You would then have static factory methods that connect to foreign servers via different transport types. |
Create them from context instead.
The text was updated successfully, but these errors were encountered: