下载了几个,由于其加入了自己的逻辑等等,弄得挺复杂,反倒看不懂了。

解决方案 »

  1.   

    看《Windows网络编程技术》里边讲的比较好。
      

  2.   

    《Windows网络编程技术》,下载源码,上面有例子的
      

  3.   

    "Windows 网络编程第二版"里的.
    // Assume we have a connected socket named MySocketPerIOData PData;
    PData.s = MySocket;public AsyncCallback AsyncReceiveCallback = new 
    AsyncCallback(ProcessReceiveResults);MySocket.BeginReceive(PData.Buffer, 0, PData.Buffer.Length, 
    SocketFlags.None, AsyncReceiveCallback, PData);public static void ProcessReceiveResults(IAsyncResult ar)
    {
    PerIOData PData = (PerIOData) ar.AsyncState; int BytesReceived = PData.s.EndReceive(ar);   // Do something about your received results
       . . . 
    }public class PerIOData
    {
       // Put whatever data you need here for the delegate method.
       // Most applications will probably define the data buffer
       // here for the received data.
       byte [] Buffer = new byte[4096];
       Socket s;
       . . . 
    }
      

  4.   

    http://support.microsoft.com/kb/197728
      

  5.   

    在 win32多线程程序设计 里有个例子。