After a server accepts a client connection on a certain port, a new socket is
created on the server on a system managed dynamic port to handle the
connection. Please confirm this.
If so, how can I get the number of the dynamic port in the server (in server
code)? Using LocalEndPoint.P ort just returns the original listener port
number.
Thanks,
Jason 5 4042 http://msdn.microsoft.com/library/de...pointtopic.asp
Erick Sgarbi After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this.
If so, how can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.P ort just returns the original listener port number.
Thanks,
Jason
No, I don't need the client's port number, I need the server's new port
number for that instance socket.
Jason
"er***@csharpbo x.com" wrote: http://msdn.microsoft.com/library/de...pointtopic.asp
Erick Sgarbi
After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this.
If so, how can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.P ort just returns the original listener port number.
Thanks,
Jason
Hi,
"Jason" <Ja***@discussi ons.microsoft.c om> wrote in message
news:6D******** *************** ***********@mic rosoft.com... After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this.
No, that's not true. It creates a new Socket but keeps using the same port.
A TCP server can have multiple client connections to the same port.
HTH,
Greetings If so, how can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.P ort just returns the original listener port number.
Thanks,
Jason
Well then how does the server (underneath) resolve which socket steam should
recieve incoming packets? I thought this was done by creating the instance
socket on the server with a new port in the system managed dynamic port range.
Thanks,
Jason
"Bart Mermuys" wrote: Hi,
"Jason" <Ja***@discussi ons.microsoft.c om> wrote in message news:6D******** *************** ***********@mic rosoft.com... After a server accepts a client connection on a certain port, a new socket is created on the server on a system managed dynamic port to handle the connection. Please confirm this.
No, that's not true. It creates a new Socket but keeps using the same port. A TCP server can have multiple client connections to the same port.
HTH, Greetings
If so, how can I get the number of the dynamic port in the server (in server code)? Using LocalEndPoint.P ort just returns the original listener port number.
Thanks,
Jason
Hi,
"Jason" <Ja***@discussi ons.microsoft.c om> wrote in message
news:C7******** *************** ***********@mic rosoft.com... Well then how does the server (underneath) resolve which socket steam should recieve incoming packets?
When there are multiple connections to the same server ip and server port ,
then either the client's ip or client's port is different or both.
Underneath it not only uses server ip and port but also client ip and port
to resolve the right Socket.
I thought this was done by creating the instance socket on the server with a new port in the system managed dynamic port range.
No, it's not, if you use windows you can use the commandline tool 'netstat'
to see that the _same_ server port is used when you have accepted a number
of connections.
For detailed explaining i can only recommend reading the RFC's about the TCP
protocol.
hth,
Greetings
I thought this was done by creating the instance socket on the server with a new port in the system managed dynamic port range.
Thanks,
Jason
"Bart Mermuys" wrote:
Hi,
"Jason" <Ja***@discussi ons.microsoft.c om> wrote in message news:6D******** *************** ***********@mic rosoft.com... > After a server accepts a client connection on a certain port, a new > socket > is > created on the server on a system managed dynamic port to handle the > connection. Please confirm this.
No, that's not true. It creates a new Socket but keeps using the same port. A TCP server can have multiple client connections to the same port.
HTH, Greetings
> > If so, how can I get the number of the dynamic port in the server (in > server > code)? Using LocalEndPoint.P ort just returns the original listener > port > number. > > Thanks, > > Jason This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dana Marcusanu |
last post by:
Yes. I want to write a very small web sniffer that gets data from a
specified port. I already looked at some of the existing ones on Internet,
but they are not in Python (I am trying to learn Python!) and they have a
lot more features that I want. Thanks for your suggestion. I will check
out pcap library.
Dana
On 2005-02-01, Dana Marcusanu <dmarcus...@yahoo.com> wrote:
|
by: anketm |
last post by:
I am writing a simple client using UDP sockets.
I am wondering if there is any way to determine what local port a
socket was bound to when bind() is not explicitly called.
This is what my program looks like:
sock = socket(PF_INET, SOCK_DGRAM, 0);
sendto(sock, message, strlen(message) + 1, 0, (struct sockaddr *)
&server, sizeof(server));
|
by: Jason |
last post by:
After a server accepts a client connection on a certain port, a new socket is
created on the server on a system managed dynamic port to handle the
connection. Please confirm this.
If so, how can I get the number of the dynamic port in the server (in server
code)? Using LocalEndPoint.Port just returns the original listener port
number.
Thanks,
|
by: Marc |
last post by:
How could I directly trigger a very simple on localhost and a known port
listening server from my internet browser client? Local host means the
little server would be running on the client machine, where my browser
resides. Browser would be IE, O.S. Windows 2000 or XP, and it's for an
intranet application. The goal of the little server on the localhost client
side would be to trigger a scanner, with the TWAIN library. Also this server
is...
|
by: Sharon |
last post by:
Hi all,
I've implemented a TCP server using the Socket async methods.
When connecting to the server from 3 instances of hyper terminal,
i've noticed that each of the newly created server sockets, uses the same
server port.
I assumed that a new connection will receive a unique port.
If this is the way its suppose to work, is it a performance issue?
Is it possible that connections from the same IP will connect on the same
server port?
I...
| |
by: jasonsgeiger |
last post by:
From: "Factor" <jasonsgeiger@gmail.com>
Newsgroups: microsoft.public.in.csharp
Subject: Multiple Clients, One port
Date: Wed, 19 Apr 2006 09:36:02 -0700
I'm been working with sockets for a short while now using a server
program a former coworker started. The program listens on a port for
incomming connections. When a valid connection is made (we send this
init string into the socket from the clients) the server closes the
socket so...
|
by: =?Utf-8?B?Vmlua2k=?= |
last post by:
Hello everyone,
I have this code for TCPListenPort. The code works fine, but my manager is
asking me to establish multiple connections to the same port. How can i
acheive that
below is my code
Int32 port = Int32.Parse(ConfigurationManager.AppSettings);
|
by: Giampaolo Rodola' |
last post by:
Hi there,
since the socket.socket.family attribute has been introduced only in
Python 2.5 and I need to have my application to be backward compatible
with Python 2.3 and 2.4 I'd like to know how could I determine the
family of a socket.socket instance which may be AF_INET or AF_INET6.
Is there some kind of getsockopt() directive I could use?
For now I've been able to determine the family by using:
# self.socket = a connected...
|
by: kash123 |
last post by:
Hi All,
I have written an application, a part of which, in the application, is a socket server programe accepting connection requests from socket clients.
My server code typically contains,
a call to socket, bind, listen, accept and later read and write using the accept file descriptor (fd).
The client socket prog is so designed (who ever did so!) that every certain time period it closes the connection with the server and reconnects...
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |