Winsock Protocol Errors - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Winsock Protocol Errors

locoloco Posts: 173Member
Hi

I have been trying to sent text from one PC to the other using Winsock and I get the following errors: "wrong protocol or connection state for the requested transaction or request". Do you know why?

Loco

Comments

  • GideonOmegaGideonOmega Posts: 617Member
    : Hi
    :
    : I have been trying to sent text from one PC to the other using Winsock and I get the following errors: "wrong protocol or connection state for the requested transaction or request". Do you know why?
    :
    : Loco
    :
    that probably means that the winsock you are using to connect to the other pc is not connected meaning either there is an error in how you are connecting to the other pc or the winsock on the other end is not listening.

    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

  • rhnetrhnet Posts: 99Member
    : : Hi
    : :
    : : I have been trying to sent text from one PC to the other using Winsock and I get the following errors: "wrong protocol or connection state for the requested transaction or request". Do you know why?
    : :
    : : Loco
    : :
    : that probably means that the winsock you are using to connect to the other pc is not connected meaning either there is an error in how you are connecting to the other pc or the winsock on the other end is not listening.
    :
    : [blue]
    : C:Dos
    : C:Dos Run
    : Run Dos Run
    : [/blue]
    :
    :
    After you disconect, windows holds that port for about four minutes to make shure that it is 'really gone'. KDivad knows what to do, for I forgot.
    David
  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : : : I have been trying to sent text from one PC to the other using Winsock and I get the following errors: "wrong protocol or connection state for the requested transaction or request". Do you know why?
    : : :
    : : : Loco
    : : :
    : : that probably means that the winsock you are using to connect to the other pc is not connected meaning either there is an error in how you are connecting to the other pc or the winsock on the other end is not listening.
    : :
    : : [blue]
    : : C:Dos
    : : C:Dos Run
    : : Run Dos Run
    : : [/blue]
    : :
    : :
    : After you disconect, windows holds that port for about four minutes to make shure that it is 'really gone'. KDivad knows what to do, for I forgot.
    : David
    :

    Set .LocalPort to 0, connect and then read .LocalPort (if you want to know what it is). Setting it to 0 tells winsock to (randomly?) use the next available port.

    Anyway, that would give you the "port in use" error I believe. I've only gotten his error when I attempted to send data when the winsock component wasn't connected. Though you should also get that error if you try using UDP techniques when you're open for TCP/IP and vice versa.
Sign In or Register to comment.