简体   繁体   中英

TCP/IP Sockets API Book

I have recently bought this book to get to know some basics about building networking sockets under windows. I'm having problems with compiling the code written in this book for example - in first program it tells you to include

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

I tried these in visual c++ but the compiler return errors; include files not found. has anyone read from the book or know something about it?

In Windows you need to include WinSock2.h to get access to the Windows Sockets API. The info in your question looks like it's targeted at Unix system sockets access.

Windows Sockets API (WinSock v2.0) docs are here . The actual function calls from Unix sockets are mostly also available on Windows but there are also a bunch of Windows-specific functions named WSA* that are very helpful in writing efficient Windows-specific sockets code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM