java's ServerSocket in .net
I've got a simple server (e.g. echo) written in Java. It uses ServerSocket class for networking purposes. I've got a client in C++. it uses WinSock2.h. (unfourtantly, I completely don't know C++) They both run on one PC.
I'd like to use a C# server instead of Jav开发者_Go百科a one. It should be easy - In Java networking takes about one screen of code, so, I guess, it's not going to take more in C#.
I've never worked with networking applications before, so i don't have an idea what class and what preferences I should use in .net (instead of ServerSocket). I don't need a complete solution, but please, give me a clue. I can provide any additional information if needed.
Thank u advance, sorry 4 my English.
Have a look at the TcpListener Class.
TcpListener Class
Listens for connections from TCP network clients.
MSDN has a complete example how to use set up a simple TCP server using this class.
Use System.Net.Socket
精彩评论