winsock api vs winsock control 
Author Message
 winsock api vs winsock control

When using the winsock control on MS windows platform, setting the local ip
address is not necessary, however, on my machine it is by default the
intranet ip of 192.168.0.1. Using the control, I can connect to my pop
server. However, when I attempt the same thing using the api I cannot. I
must explicity set the local ip to be that of my isp provider when using the
winsock api.
Is my pop server only accepting connections from the ip address it provides
? If so, does the winsock control manage the routing ? If that is so, then
how can accomplish the same using the winsock api ? Another question is what
would be the algorithm for masking an ip address and determine whether it is
a broadcast address or not ( I am assuming that this is somehow a clue to
the problem but I am not sure)
The goal is to use the winsock api. But I have to consider configurations
such as mine with multiple ip addresses and be able to determine the one to
use for the local ip. I thought about using getadaptersinf() and looping
through them all attempting to make a connection but I doubt this is
optimal - but then again - I don't know....
Any help would be appreciated,
Robert


Mon, 20 Oct 2003 03:19:56 GMT  
 winsock api vs winsock control
local.sin_addr.s_addr = (!interface)?INADDR_ANY:inet_addr(interface);
 is the answer to ALL my problems.

Robert



Quote:
> When using the winsock control on MS windows platform, setting the local
ip
> address is not necessary, however, on my machine it is by default the
> intranet ip of 192.168.0.1. Using the control, I can connect to my pop
> server. However, when I attempt the same thing using the api I cannot. I
> must explicity set the local ip to be that of my isp provider when using
the
> winsock api.
> Is my pop server only accepting connections from the ip address it
provides
> ? If so, does the winsock control manage the routing ? If that is so, then
> how can accomplish the same using the winsock api ? Another question is
what
> would be the algorithm for masking an ip address and determine whether it
is
> a broadcast address or not ( I am assuming that this is somehow a clue to
> the problem but I am not sure)
> The goal is to use the winsock api. But I have to consider configurations
> such as mine with multiple ip addresses and be able to determine the one
to
> use for the local ip. I thought about using getadaptersinf() and looping
> through them all attempting to make a connection but I doubt this is
> optimal - but then again - I don't know....
> Any help would be appreciated,
> Robert



Mon, 20 Oct 2003 03:55:28 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. winsock api vs winsock control

2. VB6 Winsock Control vs. Winsock API

3. Winsock vb Control vs Winsock 32 API??

4. VB6 Winsock Control vs. Winsock API

5. Winsock OCX vs Winsock API?

6. Winsock OCX vs. Winsock API

7. WinSock control CPU hog and gimme WinSock API! :)

8. use the winsock Control or winsock API

9. use the winsock Control or winsock API

10. winsock api, not winsock control

11. Winsock.ocx vs Winsock.dll

12. Winsock.bas (pure Winsock API programming)

 

 
Powered by phpBB® Forum Software