I am very new to VC and I land myself in a catch 22 situation...
here's what I have to do...
1) Connect to a server using a SPECIFIED port and an IP
2) If the server sends -1 then it's an error
its a success..
How and what do I use for this...
I'd appreciate if you can help me out with either the code
or specify any link to take the sample from..
I recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.
not to be simplistic here but....
if( // your code// != -1)
// Insert your success code here.
// Insert your failure code here.
I think he's asking for functions.
socket() creates a socket, connect() allows you to connect that socket to a server. either one of those failing is a bad thing obviously and would give you an oportunity to return -1.
if that's what you're asking.
Look up WSASend(), WSARecv(), etc. at MSDN. I recommend a book on networking program for Windows. You will need to analyze differnt I/O models.
>>How and what do I use for this...
Try a tutorial...! :)