-
Network Programming
Ok, I don't even know if thats what its called... but I want to learn how to program things to work over the internet and local networks... Obviously, I'm very new to that (Although I know C++ somewhat now...) Does anyone know where I could learn this kind of thing?
-
Search Google or the cprogramming.com directory for something called Winsock.
-
Is there any way to do it without using winsock?
-
> Is there any way to do it without using winsock?
Use linux as your operating system
-
Ok... What IS Winsock? From looking at the stuff at MSDN it's a "Windows Socket"... that helped me not.
-
If you do a search this info will be easy to find.
From a little while ago
-
http://code.box.sk/box.php3?noup=yes...txt=Networking
your answer is here.
read beej's guide thats how I learned sockets.
I beleive sockets are easier in linux than windows as there is no intialising winsock, however if youve got to use windows then read the winsock FAQ it tells you all you need to know and more.
-
it depends what type of network programing you want to do - if you want to client/server stuff or internet updates and things like that - you need to use winsock, probablly you will need to learn a little tcp/ip aswell.
For lan programming you can use the same (for ethernet) however for serial / parallel networks i dont think you can use winsock, im trying to write some parallel networking software - and im trying to come up with my own protocols to control it
-
Quote:
Originally posted by vVv
Actually, it's almost the same. Both, Windows and *x have the same API functions. On Win, you just have to paste this snippet at the beginning of your code:
Code:
/* initialize windows sockets */
{
WSADATA wsa;
if (WSAStartup(MAKEWORD(1, 1), &wsa))
{
printf("WSAStartup() failed, %lu\n", (unsigned long)GetLastError());
return EXIT_FAILURE;
}
}
...use the datatype SOCKET instead of int for creating a socket. And Windows knows closesocket() instead of close() (from unistd.h)... These are all the differences i can think of atm... Just use #ifdef's for these parts.
not quite!
the one major difference which I dont like is that *nix allows you to cycle through stdin as part of a descriptor set when using select and windows doesnt. its easy to get round but its my preffered way of coding servers.
-
Couldn't you also use DirectPlay from DirectX?