What is a “Bullet-proof” method of setting up a SOCKET using Visual C++.net??? I’ve been trying to run it with my code but I KEEP getting an ERROR when it RUNs. The code is as follows:
String^ remoteName = “localhost”;
Socket^ clientSocket = gcnew Socket( AddressFamily::InterNetwork,SocketType::Stream,ProtocolType::Tcp );
System::Net::IPAddress^ ipAddress = System::Net::Dns::GetHostEntry(“localhost”)->AddressList[0];
IPEndPoint^ ipEndPoint = gcnew IPEndPoint( ipAddress, 1800 );
clientSocket->Connect( ipEndPoint );
I’m using Visual C++.net on Visual Studio.net 2005 Frameworks (3.0).
*** Note: ***
I can NOT use the “Dns::Resolve” command since its been obsoleted…