Struct sockaddr, sin_family is not a member
- by leon22
According to this article from msdn (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740496(v=vs.85).aspx) the struct varies depending on which protocol is selected!
Now I want to use this code from http://www.intelliproject.net/articles/showArticle/index/check_tcp_udp_port to check if a port is open or not!
Now I have the struct sockaddr as follows:
struct sockaddr {
ushort sa_family;
char sa_data[14];
};
but need this strcuture:
struct sockaddr {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
Which changes are necessary?
(Ws2_32.lib is linked and following includes
#define WIN32_LEAN_AND_MEAN
// sockets
#include "windows.h"
#include <winsock2.h>
#include <ws2tcpip.h>
Thx