// Module Name: iocmplt.cpp // // Description: // // This sample illustrates how to develop a simple echo server Winsock // application using the completeion port I/O model. This // sample is implemented as a console-style application and simply prints // messages when connections are established and removed from the server. // The application listens for TCP connections on port 5150 and accepts them // as they arrive. When this application receives data from a client, it // simply echos (this is why we call it an echo server) the data back in // it's original form until the client closes the connection. // // Compile: // // cl -o iocmplt iocmplt.cpp ws2_32.lib // // Command Line Options: // // iocmplt.exe // // Note: There are no command line options for this sample. #pragma comment(lib, "ws2_32") #include <winsock2.h> #include <windows.h> #include <stdio.h> #define PORT 5150 #define DATA_BUFSIZE 8192 typedef struct }