Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6676221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:57:36+00:00 2026-05-26T03:57:36+00:00

pls advise why this happens. on a simple sample server app i have the

  • 0

pls advise why this happens.
on a simple sample server app i have the following code:

procedure TForm13.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var str : string;
begin
  str := socket.ReceiveText;
  showmessage(str);
end;

and on the client side i have

clientsocket1.Open;
clientsocket1.Socket.SendText(txtMSG.Text);

nothing fancy.
the strange thing is that when i send a message to the server for 1st time it gets ignored. every time after that it works great. the ClientRead event doesn’t fire off at all on the 1st message

what can i change on the server to make it accept the 1st message.
I have no control over the client side as a 3rd party sends me messages, ut i am always missing the 1st message.

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:57:37+00:00Added an answer on May 26, 2026 at 3:57 am

    If you are using the TClientSocket in non-blocking mode (which is the default), you can’t send data immediately after Open() returns, as the connection is not ready yet. You have to wait for the OnConnect event to be triggered first, eg:

    Procedure TForm1.StartConnectingToServer;
    Begin
      ClientSocket1.Open;
    End;
    
    Procedure TForm1.ClientSocket1Connect(Socket: TCustomWinSocket);
    Begin
      Socket.SendText(txtMSG.Text);
    End;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pls i have the following code in my model Letter.count(:id, :conditions => [language_id =
I tried this code but is not working .. protected void btnAbc_Click(object sender, EventArgs
pls help me. how can I split this String value? my code below wont
I have this html form to pass my data from iphone to web server..
pls look at following piece of code. for (int j = 0; j <
I have doubt in access query... Pls advise is it possible i have linked
pls use this http://code.google.com/p/google-web-toolkit-doc-1-6/wiki/DevGuideJavaFromJavaScript IFI means int float int but if i want to
Pls check code .html form gets submitted even if javascript returns false. <form id=form1
I am trying to create a slider like this example. pls anyone help me.
Pls have a look at http://jsfiddle.net/chugh97/YWVA8/56/ I have frozen the Inv No column. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.