Advertisement

winsock

Started by January 10, 2001 04:39 PM
1 comment, last by AlexM 24 years ago
I'm using MFC 4.0 CAsyncSocket::Create and it doesn't let me specify an IP address. It says WinSock2 automatically picks an IP, but when I check it later it is 0.0.0.0. I need my client programs to be able to contact a server... Is there a way to get this function to accept an address, maybe the default IP for the machine? Or is there another way to find the server on the net? Thanks in advance, Alex. Edited by - AlexM on January 10, 2001 5:41:32 PM
You do have a network card & the tcp/ip protocol installed right?
If you have a modem, then you need to be dailed-in & connected to get an IP address.

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
CAsyncSocket::Create() accepts the address to bind() against as the last parameter (the lpszSocketAddress string, default is NULL).

quote:
BOOL Create( UINT nSocketPort = 0, int nSocketType = SOCK_STREAM, long lEvent = FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE, LPCTSTR lpszSocketAddress = NULL );


Though if this is the code for the client side, you shouldn''t be calling CAsyncSocket::Create(), instead use CAsyncSocket::Connect().

This topic is closed to new replies.

Advertisement