typedef struct sockaddr {
ADDRESS_FAMILY sa_family;
CHAR sa_data[14];
} SOCKADDR, *PSOCKADDR;
How to implement the second parameter sa_data[14]. I want to establish connection to destination so i need to set the remote address here.
typedef struct sockaddr {
ADDRESS_FAMILY sa_family;
CHAR sa_data[14];
} SOCKADDR, *PSOCKADDR;
How to implement the second parameter sa_data[14]. I want to establish connection to destination so i need to set the remote address here.
It is an address-family-specific stuff.
Look at “sockaddr_in” structure.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
>
> typedef struct sockaddr {
> ADDRESS_FAMILY sa_family;
> CHAR sa_data[14];
> } SOCKADDR, *PSOCKADDR;
>
> How to implement the second parameter sa_data[14]. I want to establish connection to destination so i need to set the remote address here.
>
Can you give me an example code. i am Getting this error code when combining with it.
“no suitable conversion function from “sockaddr_in” to “PSOCKADDR” exists”
xxxxx@yopmail.com wrote:
typedef struct sockaddr {
ADDRESS_FAMILY sa_family;
CHAR sa_data[14];
} SOCKADDR, *PSOCKADDR;How to implement the second parameter sa_data[14]. I want to establish connection to destination so i need to set the remote address here.
Google is a lot faster than this mailing list. This structure dates
back to the very beginning of sockets programming, in 1983.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms740496.aspx
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
xxxxx@yopmail.com wrote:
Can you give me an example code. i am Getting this error code when combining with it.
“no suitable conversion function from “sockaddr_in” to “PSOCKADDR” exists”
Literally ANY example of socket programming on the web would show you
how these structures are handled, including the page I pointed to in my
previous message (which, I do realize, arrived after you sent this).
Typically, you create your local structure as a “struct sockaddr_in”,
then pass the address of that structure to the socket APIs after casting
it to (PSOCKADDR).
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.