I'm new to the world of sockets, and this question is not VB specific:
If multiple clients access the same server on the same port, and the server
is set up to do some async communication, does the server's response GO back
to
all the clients on that port, or just to the one who sent the request?
In other words:
Client One - Request Data From Server (It takes a few seconds for the server
to get the answer)
Client Two - Requests Data From Server (this also takes a couple seconds)
The server, on two asyncy threads is processing both requests.
It gets the results for one of the clients and sends the RESULT back up the
socket it is holding for that client.
(here's the question:)
Do both clients 'see' this result and have to determine if it belongs to
them, or does a socket object somehow encapsulate the communication, so that
only the calling client will get the answer?
Hope this question makes sense and someone knows the answer!
thanks. 2 1227
ZorpiedoMan wrote: I'm new to the world of sockets, and this question is not VB specific:
If multiple clients access the same server on the same port, and the server is set up to do some async communication, does the server's response GO back to all the clients on that port, or just to the one who sent the request?
In other words:
Client One - Request Data From Server (It takes a few seconds for the server to get the answer) Client Two - Requests Data From Server (this also takes a couple seconds)
The server, on two asyncy threads is processing both requests. It gets the results for one of the clients and sends the RESULT back up the socket it is holding for that client.
(here's the question:)
Do both clients 'see' this result and have to determine if it belongs to them, or does a socket object somehow encapsulate the communication, so that only the calling client will get the answer?
Hope this question makes sense and someone knows the answer!
thanks.
Your question makes perfect sense :) Basically, the answer is that each
connection to the server results in a new socket that then handles all
communication to the connected client. In this way, responses are unique
to each client. There are several good examples of using async sockets in
the .NET help. I would look those up and study them.
Tom Shelton
Hi,
Thanks for your post.
Tom in right here. A socket is a communication endpoint ¡ª an object
through which a Windows Sockets application sends or receives packets of
data across a network. A socket has a type and is associated with a running
process, and it may have a name. Currently, sockets generally exchange data
only with other sockets in the same "communicat ion domain", which uses the
Internet Protocol Suite.
In Socket programming, server listens on a specific port. When it receives
a connection from a client, it will spawn a new socket and communicate with
that client on that new socket. So each client is communicating with server
in a private channel. They won't impact each other.
Hope this helps.
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tim Black |
last post by:
My application requires sending a large piece (~2MB) of data to
several devices on a network via TCP sockets. I have experimented with
different methods for doing this and this has raised some questions
about the implementation of Python sockets.
(both methods use blocking sockets)
Method 1: Calls socket.sendall(data) for each device in sequence, all
in a single thread.
|
by: 0to60 |
last post by:
I have a question about socket programming in general.
Exactly what happens behind the scenes when I one socket connects to a
different socket in listen mode? Using the dotnet framework, I create a
socket, bind it to a port, put it in listen mode, and then n sockets can
connect to it. The code:
Socket newSocket = listeningSocket.Accept();
returns a socket. I can communicate on newSocket, and listeningSocket goes
|
by: pankaj_wolfhunter |
last post by:
Hi,
I need some clearance on the following questions:
1) Does LOAD command updates indexes defined for a table?
2) Is REPLACE option in the LOAD command a logged operation?
Help will be greatly appreciated.
TIA
|
by: BadOmen |
last post by:
Hi,
What is the different between 'System.Net.Sockets.Socket' and
'System.Net.Sockets.TcpClient'?
When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket??
Yours, Jonas
|
by: Christoph Zwerschke |
last post by:
Sometimes I find myself stumbling over Python issues which have to do
with what I perceive as a lack of orthogonality.
For instance, I just wanted to use the index() method on a tuple which
does not work. It only works on lists and strings, for no obvious
reason. Why not on all sequence types?
Or, another example, the index() method has start and end parameters for
lists and strings. The count() method also has start and end parameters...
| |
by: Steven |
last post by:
Hi,
I need to write an application using sockets.
I have a server and about 10 clients "speaking" at the same time with the
server, so i guess i need to use asynchronous sockets.
But the server will receive from the clients an ascii string with a
viariable length.
And in all the example i found, the size of the buffer is always fixed
(private byte theBuffer = new byte).
I probably misunderstood the use of the buffer !
|
by: Arash Partow |
last post by:
Hi all,
I've ported various hash functions to python if anyone is interested:
def RSHash(key):
a = 378551
b = 63689
hash = 0
|
by: Cichy |
last post by:
Hello,
I'm writing a Client-Server application using sockets (asynchronous).
There is a Server (Master) which accepts incoming connections, and
Client (Slave).
Afetr establishing connections with all Slaves I wanna hit a button
"Automatic", then everything must be reorganised, there is an
ellection for a new Master.
Everything is all right when I'm connecting manually (when I hit a
button connect), but after hitting this button...
|
by: Gurur |
last post by:
Hi all,
I have a doubt.
If I have 2 structures and one is parent of other , ie the child
structure is present in the parent one . And if the child structure is
declared as dynamic array in the parent , will it be possible to pass
the parent structure thru network using sockets onto other application
running on different system provided the API is known to both the
sender and the receiver.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |