Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

AlexM

winsock

This topic is 6342 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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().

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!