| |

VerySource

 Forgot password?
 Register
Search
View: 1744|Reply: 2

ClientSocket control receiving messages under c++ builder6.0

[Copy link]

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-10 10:00:02
| Show all posts |Read mode
I use ClientSocket and serverSocket to communicate with both parties under c++ builder 6.0. When the client sends a message to the server, the server can receive it normally, but when the server sends a message to the client, the client is either in the onread() or onwrite() event I can’t receive the message. I added a button on the client and wrote it in its double-click event: Memo2->Lines->Add(ClientSocket1->Socket->ReceiveText()); The result is displayed correctly in the Memo2 control Message from the server!
This sentence should have been written in the onread() event, but why not?
Please advise! ! ! ! ! ! ! !
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-11-10 13:15:01
| Show all posts
Pay attention to whether the sending and receiving ports are correct
Reply

Use magic Report

1

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-11-10 14:45:03
| Show all posts
The port should work! Because you can receive server messages when you click the button!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list