当我进行了disconnect后为什么在 Receive 这个函数上不断的接收
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
IPHostEntry ipHost = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddr = ipHost.AddressList[0];
IPEndPoint ipEndPoint = new IPEndPoint(ipAddr, 11000);
Socket client = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
Socket server = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
server.Bind((EndPoint)ipEndPoint);
server.Listen(1024);
// Connect the socket to the remote end point.
client.Connect(ipEndPoint);
Socket soc = server.Accept();
// Send some data to the remote device.
string data = "This is a string of data <EOF> ";
byte[] buffer = Encoding.ASCII.GetBytes(data);
int bytesTransferred = client.Send(buffer);
// Write to the console the number of bytes transferred.
Console.WriteLine( "{0} &n