473,323 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Multiple local ports in system.net.sockets class

Hi

Not sure I can do what I'm trying to do without using a 3rd party
component like Dart. I need to build a windows service to create a
socket connection on an IBM mainframe using an IP and port
combination. No problem there.
However, due to the expected volume (at least 20x10K streams per
second in each direction), the mainframe sysadmin has requested the
service use multiple 'conversations' within the single IP connection.
The easiest way to do this is use different local ports when we open
the connection (Dart's component allows this), but I cannot find
anything within the .Net socket class which appears to support the
setting of a local port when opening a connection. Can this be done in
C# using the sockets class?

Thanks

John

Apr 3 '07 #1
1 3606
On Tue, 03 Apr 2007 12:40:51 -0700, jcprince <jc******@gmail.comwrote:
[...]
However, due to the expected volume (at least 20x10K streams per
second in each direction), the mainframe sysadmin has requested the
service use multiple 'conversations' within the single IP connection.
The easiest way to do this is use different local ports when we open
the connection (Dart's component allows this), but I cannot find
anything within the .Net socket class which appears to support the
setting of a local port when opening a connection. Can this be done in
C# using the sockets class?
At the face of it, your question doesn't make much sense.

First, there's no such thing as an "IP connection". IP is a low-level
protocol on which TCP and UDP are implemented, and like UDP the IP
protocol is connectionless. So, let's assume you really mean "TCP
connection".

Second, using a different local port will by definition require a new TCP
connection. A TCP connection is uniquely identified by the two endpoints
IP address and port. A single TCP connection can only have a single port
at each end.

As far as defining the port used in .NET, once a Socket has been bound to
an address, that's its address. It can only have one address (IP address
plus port). You can use the Bind() method to specify the port explicitly,
or the port will be automatically assigned from the range of unused ports
when you connect the socket to a remote endpoint. But either way, the
Socket can only have one port assigned to it.

Finally, the way you've worded your question, you are limiting the
most-specific replies to coming from people who know what "Dart" is.
Knowing what "Dart" is is not a prerequisite to knowing how to use .NET
Sockets, and so you are unnecessarily limiting your potential audience by
comparing your problem to something "like Dart".

It would be better if, rather than just saying "like Dart", you explain
what "Dart" is and what specifically it does that you would like to be
able to do in .NET. I can tell you for sure that "Dart" in and of itself
cannot provide a way to use multiple local ports on a single TCP
connection, because that's a limitation of TCP. But other than that, I
can't really compare the behavior of "Dart" to what .NET can or cannot do.

If the above doesn't answer your question, you may want to rethink how to
describe what it is you're actually trying to do and what information
specifically it is you need.

Pete
Apr 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim Kipp | last post by:
Hi I am writing a simple server to monitor ports. The problem is I don't know how to make it listen on multiple ports. It creates the first socket, listens, than accepts and of course the accept...
9
by: User | last post by:
Hi, I tried to find the information over the internet but didn't find any answers. I'm looking for a server side code example of winsock accepting many clients. I know that in VB.NET it is...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
by: nezoat | last post by:
Here is some working code to open the specified TCP port on the gateway nat device or firewall, and forward it to the calling machine. Great for p2p apps. The newsgroups are such a great...
7
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,...
2
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...
11
by: Olie | last post by:
This post is realy to get some opinions on the best way of getting fast comunication between multiple applications. I have scowered the web for imformation on this subject and have just found...
5
by: zxo102 | last post by:
Hi, I am doing a small project using socket server and thread in python. This is first time for me to use socket and thread things. Here is my case. I have 20 socket clients. Each client send a...
27
by: cmdolcet69 | last post by:
Can anyone tell me if its possible to do multiple event args in vb.net?
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.