HTML and CSS Reference
In-Depth Information
Figure 13-4. Creating a console application project
2.
In the Solution Explorer, right-click the WsServer project and select the Add ➤ Class
links. Enter WsServer.cs for the class name.
3.
Enter the code shown in Listing 13-1 for the initial implementation of this class.
Listing 13-1. Implementing the WsServer class
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Security.Cryptography;
namespace WsServer
{
public class WsServer
{
#region Members
// This socket listens for new connections
Socket _listener;
// Configurable port # that is passed in the constructor
int _port;
 
Search WWH ::




Custom Search