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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:28:25+00:00 2026-06-09T21:28:25+00:00

I am using winsock as a client with about 10 threads. Each thread has

  • 0

I am using winsock as a client with about 10 threads.

Each thread has it’s own unique connection to the same host and port.
All threads are connected and they all need to read a certain amount of bytes
at the same time. I see that I can only use 1 recv function at a time, why is that?

function RecvThread ( p : pointer ) : Integer; stdcall;
var
 Sock   : TSocket;
 Addr   : TSockAddrIn;
 res    : Integer;
begin
 Addr.sin_family      := AF_INET;
 Addr.sin_port        := htons(8080);
 Sock                 := Socket(AF_INET, SOCK_STREAM, 0);
 Addr.sin_addr.S_addr := INET_ADDR (pchar('localhost'));
 if (Connect(Sock, Addr, SizeOf(Addr)) = 0) then begin
 while true do begin
  res := recv (sock, buff, 99999, 0); // just example
  if (res < 0) or (res = INVALID_SOCKET) then break;
 end;
 // Free Stuff, Disconnect, etc...
end;
  • 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-06-09T21:28:26+00:00Added an answer on June 9, 2026 at 9:28 pm

    Is the server capable of writing simultaneously to 10 clients? Does 1 recv function at a time mean that each client receives data in sequence or that only one client works at all and the other 9 fail?

    You could try creating a chargen server to test against. Run 10 copies of that on different ports (so threads in the chargen server don’t need to be tested/considered) and connect the clients to one port each.

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

Sidebar

Related Questions

Using C and the Winsock library (UDP), I made a client-server multiplayer game. Now
I am writing a TCP server application using Winsock. The client that connects to
When using TCP under Winsock, is it possible for my client to choose its
I`m writing client-server app for windows using WinSock and I have class for server.
i am developing client server application in windows using c++ and winsock lib it
I'm trying to implement a simple FTP client using winsock. I'm having problems trying
I am using Winsock under VS 2008. I have a thread dedicated to accepting
I have a client application using winsock's sendto() method to send data to a
I'm making http requests using winsock and I need to parse the response. The
I have had nothing but trouble with Winsock since I started using it. I

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.