Windows Sockets 1.1应用实例(三十六)

2010-12-30 20:58:11 · 作者: · 浏览: 63024
p;     return (TRUE);

}

 

BOOL SendPacket(HWND hWnd, int len)

{

       int length;

 

       if ((length = send(s, lpBuffer, len, 0)) == SOCKET_ERROR)

              return (FALSE);

       else

       if (length != len)

       {

              AlertUser(hWnd, "Send Length NOT Match!");

              return (FALSE);

       }

       return (TRUE);

}

 

程序3:SERVER.C

#include <sys/types.h>

#include <sys/mntent.h>

#include <netinet/in.h>

#include <sys/socket.h>

#include <arpa/inet.h>

#d