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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:18:51+00:00 2026-05-31T01:18:51+00:00

I created a server socket on my side. I don’t know when client connects

  • 0

I created a server socket on my side. I don’t know when client connects to me.

Calling a serverSocket.accept() in my application without setting any socket timeout would solve my problem of accepting the client at any point of time. I am doing this in a separate thread, so this wouldn’t block another part of my application.

My concern is since accept() blocks till it gets a call from a client wouldn’t this consume any resources, may be like if I don’t get a call from the client side program for about a week.

Is there any other way of accepting the client side connection. I don’t have any information on when client calls for a socket connection, except that it calls at some point.

  • 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-31T01:18:52+00:00Added an answer on May 31, 2026 at 1:18 am

    There is no problem with calling accept on a different thread. The thread will be blocked in the call to accept and will not be scheduled by the operating system until a connection in inbound. Practically, if you don’t get a connection the entire week your thread will not run on the CPU during this time.

    Therefore, it will not consume any CPU resources and only a bit of memory.

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

Sidebar

Related Questions

I have created small socket programs (client/server). Client will transfer all formats of files
We create a socket. On one side of the socket we have a server
Server has created a socket and bound to a port and started a thread
I want to create SOCKET chat(server + clients) with private messaging. When client write
I use dephi7's client/server socket components to send a file with tfilestream from client
I need to create Client/Server application to send files from clients to Server. I
I have a Python server script and a Java client application and the goal
In our application, we are using RMI for client-server communication in very different ways:
I have created a basic Client Server that will send image files in a
Recently I was designing a simple ftp. When a client connects to server, server

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.