> sockaddr_in __pin * pinned_ServerSockAddrIn; //This statement is nor executed. It jumps to next statement directly
> pinned_ServerSockAddrIn = &ServerSockAddrIn;
The first statement is skipped because it is just a declaration that
doesn't contain any code to execute. The variable isn't actually
initialized until the following statement. I would normally combine the
declaration and the initialization into a single statement:
sockaddr_in __pin * pinned_ServerSockAddrIn = &ServerSockAddrIn;
This won't change the behavior of your code at all, so if you are having
problems, the problems are somewhere else.

Signature
David Olsen
qg4h9ykc5m@yahoo.com
Alper Akcayoz - 21 May 2004 08:01 GMT
Hello David
Thank You very much for your response.
I have tried your recommendation before. As you mentioned that the problem seems to be somewhere else. Problem is at the bind() and then, of course, at the listen() functions. When I use the following code, the bind() returns Error#10047 that is "Address family not supported by protocol family". The code is as follows
sockaddr_in __pin * pinned_ServerSockAddrIn = &ServerSockAddrIn
retBindVal = bind(ServerSocket, (struct sockaddr*)&pinned_ServerSockAddrIn, sizeof(*pinned_ServerSockAddrIn) )
I found a solution for the "struct" casting. At this code, there is not any __pin. Therefore the first line above is omitted. The working code is as follows
retBindVal = bind(ServerSocket, (struct sockaddr*)&pinned_ServerSockAddrIn, sizeof(*pinned_ServerSockAddrIn) )
I would like to thank your consideration, again
Alper Akcayoz - 21 May 2004 08:11 GMT
Hello David
I notices that I wrote the wrong code to my previous response
Working code is as follows
retBindVal = bind(ServerSocket, (LPSOCKADDR)&ServerSockAddrIn, sizeof(ServerSockAddrIn));