-
Notifications
You must be signed in to change notification settings - Fork 5.3k
avoid using TcpClient in FtpWebRequest #67881
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl Issue DetailsTo point made in #63162 - TcpClient is really useless in most cases. In this case it really does not provide anything beyond
|
gfoidl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits.
src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs
Outdated
Show resolved
Hide resolved
| int port = _uri.Port; | ||
|
|
||
| TcpClient client = new TcpClient(); | ||
| var client = new Socket(SocketType.Stream, ProtocolType.Tcp); ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| var client = new Socket(SocketType.Stream, ProtocolType.Tcp); ; | |
| var client = new Socket(SocketType.Stream, ProtocolType.Tcp); |
src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs
Outdated
Show resolved
Hide resolved
ManickaP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the nits pointed out by @gfoidl looks good.
To point made in #63162 - TcpClient is really useless in most cases. In this case it really does not provide anything beyond
GetStream()and it costs extra object to be allocated.