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 316821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:25:08+00:00 2026-05-12T08:25:08+00:00

So I’m having this application that verifies weather a user can log-in or not.

  • 0

So I’m having this application that verifies weather a user can log-in or not.

It consists of multiple Clients (up to 200) and a server that processes the login querys (containing Username, PW and IP). The Server checks weather the user exists and sends an answer back.

TLoginQuery is a Record.

procedure TLogin_Form.btnLoginClick(Sender: TObject);
 var LoginQuery1: TLoginQuery;
begin
 if not LoginSocket.Active then
  begin
   LoginSocket.Open;
  end;

//Paketchen schnüren.
 LoginQuery1.Name := ledtName.Text;
 LoginQuery1.Passwort := ledtPasswort.Text;
 LoginQuery1.IP := LoginSocket.Socket.LocalAddress;
//LoginQuery ín den Socket legen.
 LoginSocket.Socket.SendBuf(LoginQuery1, SizeOf(LoginQuery1));

end;

The Server currently reads:

procedure TServer_Form.ServerSocketClientRead(Sender: TObject;
Socket: TCustomWinSocket);
 var LoginQuery: TLoginQuery;
     uservalid: boolean;
begin
 uservalid := false;
 Socket.ReceiveBuf(LoginQuery, SizeOf(LoginQuery));
 if CheckIfUserValid(LoginQuery) then
  begin
   uservalid := true;
   ServerSocket.Socket.SendBuf(uservalid, SizeOf(uservalid));
  end;

end;

The question now is:
Does the server (as it should generally be) create a different socket connection per client?

My assumption:

ClientA sends his login data and recieves the uservalid boolean (code above) from the server. As the uservalid boolean is written into the socket connection the following happens: Just before ClientA can get the uservalid boolean (as it should be) ClientB, who is already logged in, reads from the socket and gets (as it should NOT be) the uservalid boolean.

This could be intervented using one socket per client. Right?

  • 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-12T08:25:08+00:00Added an answer on May 12, 2026 at 8:25 am

    TServerSocket.OnClientRead’s Socket: TCustomWinSocket parameter represents just that one connection between one of your clients and the server. Thus, when client Foo sends the login record, and TServer_Form.ServerSocketClientRead is called, just say

     if CheckIfUserValid(LoginQuery) then
      begin
       uservalid := true;
       Socket.SendBuf(uservalid, SizeOf(uservalid));
      end;
    

    and you’ll send the data to the right client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

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.