开发者

TCP/IP Sockets API Book

开发者 https://www.devze.com 2023-01-25 23:41 出处:网络
I have recently bought this book to get to know some ba开发者_开发知识库sics about building networking sockets under windows. I\'m having problems with compiling the code written in this book for exam

I have recently bought this book to get to know some ba开发者_开发知识库sics 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消