In Java we have Socket, BufferedReader and BufferedWriter, but what are the equivalent in C#?
Socket socket;
socket = new Socket(address, port);
reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C# you have Socket, StreamReader and StreamWriter classes. But you also have higher level classes that don’t require you to resort to sockets such as TcpListener and TcpClient. Here’s an example that connects to a listening socket and opens a stream reader that allows you to read from it: