08-25-2010, 12:22 PM
CHECK ATTACHMENTS FOR .PDF FORMAT (MUCH PRETTIER!)
Kso, as above, this is a preview of it so you know what you'll be reading. I go really in-depth into sockets and the like.
Kso, as above, this is a preview of it so you know what you'll be reading. I go really in-depth into sockets and the like.
Code:
Before we delve into any sort of code, we need to make sure you
understand the concept of “networking.” What is a socket? What is a
port? It’s okay if you don’t know the answer to these questions yet
as I shall explain them.
Okay, so, what is a port? Consider a wall socket for a moment.
Each “plug in” is a port. Only one thing can be using said “port” at
a time correct? This is also true of a computer.
If you try to bind a socket and listen on a port that’s already
in use, you will get Winsock error 10048, “WSAEADDRINUSE.” The direct
definition of this error is: “Only one usage of each address is
normally permitted.” In other words, you’re attempting to use a port
already used by something else.
So now that we know we can’t use the same port twice, let’s get
to what uses a port. Sockets. Consider our wall socket analogy again.
Sure, those “plug ins” are great and all, but they’re pretty much
useless without something to make use of them. So what do you use? A
“plug” (socket!)