-
Notifications
You must be signed in to change notification settings - Fork 76
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
Only connect TcpClient if not already connected #78
Conversation
Thanks, I'll merge it on Monday :-) |
I am not sure if this is the right approach. The constructor accepts a
So this constructor assumes that you are not yet connected and will connect on your behalf. If you want to fully manage the What do you think? Note: When we make new changes, I would also like to add IDisposable support ( #67). |
I agree with using the constructor. We should also do this for SerialPort. It did feel a bit weird passing it to the connect method. |
I have changed the constructor signatures in v5 (will be released today). Thanks anyway for hinting me into the right direction. |
Just had a look, and looks ok to me other than, ideally the IDisposable would be on the base class Also you might have to have an exception thrown somewhere if you try and reuse it after calling dispose as you don't disconnect/close each time dispose is called. |
I thought about putting it into the base class but the base class itself does not need to be disposed so from an idealistic perspective it makes more sense to put it into the implementing classes. However maybe it is different from a practical point of view. I am not sure how a use case looks like where one works with the base class I am not sure I fully understand your second point. I know I should throw |
|
Thanks for the explanations, I`ll come back to you next week. |
It appears we missed this one, but Connect needs to be called otherwise _frameBuffer and _networkStream etc won't get set.