15,885,925 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by SubratSarkar (Top 2 by date)
SubratSarkar
31-Aug-12 3:00am
View
Thanks for reply. I got your point but my concern with statement as you mentioned here -
Quote:
The address/port pair in the incoming packet identifies a machine(address) and a socket object inside (port) the networking part of the OS. Any application can have an open handle to that socket object (the handle is basically a process-local "reference counting pointer" to an object inside the OS) and any thread inside those applications can manipulate the socket object.
Here is my doubt - To access any port, I need to bind a socket to any unique port. Now application creates a socket object, get handle and send/receive data to/from port. While this thread is using this port none can get access to this port and no-one can get handle for this socket object. That means at a particular time only 1 thread can have socket handle and use specific port. So now in my example 2 threads are using the same scenario, My question is how to identify which thread is using which port ?
I am more focusing on
Quote:
a socket object inside (port) the networking part of the OS.
Apart from above doubt I have some more -
1. How is it managed by OS network part ?
2. Why do I need to create a socket ? Why can't I directly send or receive data to/from any port ?
3. How is a data packet read by thread belongs to multi-Threaded process ?
4. Is it possible for a thread can perform any operation on same port which is being used by another thread belongs to the same process?
Please correct me if I am wrong.
SubratSarkar
31-Aug-12 2:55am
View
Deleted
Thanks for reply. I got your point but my concern with statement as you mentioned here -
"<blockquote class="FQ"><div class="FQA">Quote:</div>The address/port pair in the incoming packet identifies a machine(address) and a socket object inside (port) the networking part of the OS. Any application can have an open handle to that socket object (the handle is basically a process-local "reference counting pointer" to an object inside the OS) and any thread inside those applications can manipulate the socket object. </blockquote>
Here is my doubt - To access any port, I need to bind a socket to any unique port. Now application creates a socket object, get handle and send/receive data to/from port. While this thread is using this port none can get access to this port and no-one can get handle for this socket object. That means at a particular time only 1 thread can have socket handle and use specific port. So now in my example 2 threads are using the same scenario,
My question is how to identify which thread is using which port ?
I am more focusing on <blockquote class="FQ"><div class="FQA">Quote:</div>a socket object inside (port) the networking part of the OS.</blockquote>
Apart from above doubt I have some more -
1. How is it managed by OS network part ?
2. Why do I need to create a socket ? Why can't I directly send or receive data to/from any port ?
3. How is a data packet read by thread belongs to multi-Threaded process ?
4. Is it possible for a thread can perform any operation on same port which is being used by another thread belongs to the same process?
Please correct me if I am wrong.