Friday, July 31, 2009

Socket Programming please help?

Okay Hi


I'm on XP ... I have a Dev C++ compiler





I'm trying to learn socket programming ...but it's difficult


and everything seems to be written for ppl who already are experts











You know when u go





#include %26lt;iostream%26gt;


using namespace std;


#include %26lt; math.h%26gt;





etc ...can someone just sketch me a basic





Hello World sort of program that will work ....





where I can just do





#include%26lt; something.h%26gt;





then





int main()





{





SOCKET CODE








return 0;





}











compile and run it as a .CPP file








?????

Socket Programming please help?
there are many socket tutorials in the web. try to search with google, or codeguru.com, gamedev.net etc.





basically, you have to create a socket, then connect to an IP address and a specific port, then you can send or receive data.





if you want to act as a server, you have to create a socket, bind it to a port and network interface, then "listen" for incoming connections; if a connection comes in, you "accept" it and then can exchange data with the foreign socket.





yes, it's a bit complicated and for experts.


No comments:

Post a Comment