Delphi Tserversocket and TclientSocket error code - 100049 Help

Status
Not open for further replies.

Ragahv

Honorable
Dec 30, 2012
10
0
10,560
Hey everytime i wish to connect my client to a server by giving the edit1.text a ip and port number to the edit2.text box, and click connect, i get the following message: error 100049 (asynchronous socket error.).

I get the message as soon as i click the connect button. The connect button is used to establish a connection. Since the socket is active, on connect i even add the following code:

error := ErrorCode;

ErrorCode := 0;

if error = 10049 then
showmessage('The port is blocked');

- That is, to control that error message i get. Even after that, i get the message box with the title: Project1. Message is, application socket error. I research on microsoft technet and ifnopoint or even MSDN but dont find answere to it. Any c++ or c coders can answere question because they may also get similar error. Could it be that the socket is old and the new windows api framwork doesnt support it?

I use delphi XE 7.
 

Hawkeye22

Distinguished
Moderator
Without seeing any code, it's hard to make any suggestions. Checking the Delphi help file for TClientSocket, there is a link to see their CHAT demo. Here is a link to that demo. Although the link is for XE8, this should work clear down to XE. This is in Delphi's object pascal. You'll need to convert to C/C++.

http://docwiki.embarcadero.com/CodeExamples/XE8/en/Chat_Room_Socket_%28Delphi%29
 
Solution
Status
Not open for further replies.