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

  • Home
  • SEARCH
  • 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 8578853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:29:16+00:00 2026-06-11T20:29:16+00:00

In a server based on AsynchronousServerSocketChannel and AsynchronousSocketChannel, how can I check whether a

  • 0

In a server based on AsynchronousServerSocketChannel and AsynchronousSocketChannel, how can I check whether a connection from a given IP address already exists? I want to send a specific message to connections that come from an IP address that is already connected (asking it to try again later; I’m dealing with very specific client-side LANs whose bandwidth will be poorly utilized if shared rather than forced to serialize by the server). However, I see no way to get a list of IP addresses to search for whether the same IP address already has a connection. Is there a more elegant/efficient way to do this other than inserting the IP addresses of each new connection to (and removing them upon closing from) something like a ConcurrentSkipListSet?

Moreover, I want to periodically gather a few network statistics from all open connections (how many chunks of a file have been uploaded, say). The only way I came up with to do this efficiently is send updates from the completion handlers (of a chunk-sending network write) to the info gathering thread using ConcurrentLinkedQueue, waking the thread any time something is inserted into the queue. I’m assuming the wake operation is non-blocking but I don’t know how expensive it may be, as I’m sure at the very least it involves an interlocked CPU instruction (which implies a memory fence and affects execution speed even further etc.). Any other suggestions?

  • 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-11T20:29:17+00:00Added an answer on June 11, 2026 at 8:29 pm

    You will have to maintain your own data structures. All TCP will give you is the sockets, from which you can get their remote addresses and ports.

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

Sidebar

Related Questions

I want to develop a client-server based desktop application using .Net 4, C# and
I'm writing http session manager (gen_server based). That server creates and removes session from
Does anyone know how can I do a count in SQL Server based on
I have a console application that is server based. I only want 1 instance
Because I didn't want to implement a communication protocol for my client-server based application,
I'm trying to ping a server based on an IP Address and a port,
I want to create a chat application which is client/server based. What will be
I have a graph that keeps getting dynamically changing data from our server based
I want to create a WebDAV server based on WCF restful services. Is it
How do you populate data coming from SQL server based on users request? Example:

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.