简体   繁体   English

C# .NET 4.5 TcpClient 类是用什么语言实现的?

[英]What language is the C# .NET 4.5 TcpClient class implemented in?

I was wondering if anyone knows what language was used for the implementation.我想知道是否有人知道用于实现的语言。 I looked at the msdn documentation to see if I could look at the implementation but I didn't see any there.我查看了 msdn 文档以查看是否可以查看实现,但在那里我没有看到任何内容。 I would like to know how it works at the lower levels.我想知道它在较低级别是如何工作的。

It's implemented in C#.它是用 C# 实现的。 The reference source is public.参考来源是公开的。

Eventually, the .NET code uses PInvoke to call native Win32 APIs.最终,.NET 代码使用 PInvoke 来调用本机 Win32 API。 The Socket API also uses some native CLR hooks. Socket API 还使用一些本机 CLR 钩子。 For example, in the Overlapped system.例如,在Overlapped系统中。 That seems to be a pure performance optimization to me.这对我来说似乎是纯粹的性能优化。

Basically, you could implement TcpClient yourself.基本上,您可以自己实现TcpClient Nothing magic about it.没有什么神奇之处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM