Client
Client
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace client
{
class Program
{
static void Main(string[] args)
{
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 1000);
Socket client = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
client.Connect(iep);
string input;
while (true)
{
input = Console.ReadLine();
data = new byte[1024];
data = Encoding.ASCII.GetBytes(input);
client.Send(data, data.Length, SocketFlags.None);
if (input.ToUpper().Equals("QUIT")) break;
}
client.Disconnect(true);
client.Close();
}
}
}