Thread: Winsock and Ports

  1. #1
    Registered User jimboob's Avatar
    Join Date
    Jun 2004
    Posts
    40

    Winsock and Ports

    I don't really understand what the difference is...
    I'm not stating that there isn't a difference because i've never actually programmed in neither. I thought that they were the same thing.
    Could someone please explain to me what each one is?
    TIA.

  2. #2
    mov.w #$1337,D0 Jeremy G's Avatar
    Join Date
    Nov 2001
    Posts
    704
    Winsock is the widget, gidget, gadget, or sprocket that allows for networking in win32. By that I mean it's the main thing you deal with, the functionality package?

    Ports are part of the whole networking system, you use winsock to manage ports, sending, receiving, listening, idling etc.
    c++->visualc++->directx->opengl->c++;
    (it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)

  3. #3
    Registered User jimboob's Avatar
    Join Date
    Jun 2004
    Posts
    40
    Oh Cool thanks...
    I was pretty sure that Ports are the things that I wanted to learn.
    Just one more question.
    Why would programs need to use several Ports?
    Why cant they just receive input on one port?
    Thanks

  4. #4
    Registered User
    Join Date
    Jun 2004
    Posts
    4
    Port 80 is allway's used for HTTP(web surfing) traffic. When you type in your browser www.cprogramming.com, your browser connect's to www.cprogramming.com server port 80. Then your browser(client) and www.cprogramming.com(server) are sending and reciving data from each other.

    Each program, uses its own port, because that's the way internet is made. Two programms cannot use the same port. The data would be mixed up, and it would make big problems reading the recived data. Thats why every programm use its own port. But I belive there are other resions too.

    *EDIT*

    Forgot to tell you another thing. Webservers use 80 port. Your browser send's commands to webserver. These commands are standart for HTTP Protocol. Each protocol has its own standart commands, like SMTP Protocol(Used to send e-mail) uses commands like from, Rcpt to and others. Other protocols use diferent commands. Its like each protocol talks in its own language.
    Last edited by Kristian_; 06-26-2004 at 07:47 AM.

  5. #5
    Registered User jimboob's Avatar
    Join Date
    Jun 2004
    Posts
    40
    Thanks Kristan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. RPC instead of Winsock
    By StrangeWill in forum C Programming
    Replies: 11
    Last Post: 11-28-2007, 03:33 PM
  2. Winsock connection problem
    By Nephiroth in forum C++ Programming
    Replies: 2
    Last Post: 02-07-2006, 07:54 AM
  3. Protecting ports via winsock
    By VirtualAce in forum Networking/Device Communication
    Replies: 4
    Last Post: 04-01-2004, 09:17 PM
  4. Winsock Ports
    By gnu-ehacks in forum Windows Programming
    Replies: 2
    Last Post: 03-18-2002, 09:33 AM