-
Socket Programming
Hi,
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
else
its a success..
Thats all!!
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..
Please HELP!!!!
Regards,
John
-
I recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.
Kuphryn
-
not to be simplistic here but....
Code:
if( // your code// != -1)
{
// Insert your success code here.
}
else
{
// 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.
Kuphryn
-
>>How and what do I use for this...
Try a tutorial...! :)
-