简体   繁体   中英

Delphi 11 TClientSocket can't connect to localhost, Windows socket error : 10049

So i did this tutorial exactly the same and im getting the Windows socket error: 10049. This is the tutiroal: https://docwiki.embarcadero.com/CodeExamples/Sydney/en/Chat_Room_Socket_(Delphi) What is the problem here?

The problem you are facing here is that you are stil using port 0 (default values for both TClientSocket and TServerSocket components).

You should change the port number of both client and server component to be something else than 0. I recommend using ports greater than 1024 in order to avoid using reserved ports.

In fact you might want to consider checking IANA Service Name and Transport Protocol Port Number Registry to make sure the port you will be using isn't registered to another application or service.

PS: Embarcadero should have provided information about the need to change port number used in their example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM