473,788 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple local ports in system.net.sock ets 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 3638
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
4844
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 call blocks, so it does not return to create socket for the other ports. I am doing this in windows, so using 'fcntl' to do non blocking won't work. Any suggestions? I can paste the code if need be. Thanks
9
3618
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 not implemented like in VB6. What I've done is one client per socket. Meaning that each client used a different port on the server, but I find it annoying.
6
4999
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 for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
0
27052
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 resource and have helped me so much, I hope this helps others. Let me know if you find it useful! Lee Carlson Lee (at) Carlson (dot) net -----------------------------------
7
7574
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...
2
7126
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...
11
4346
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 conflicting views and far from ideal solutions. My application has to send small amounts of data about 50bytes to multiple client applications. The catch is that this has to happen about 1000 times a second. My first attempt was .net remotting...
5
4771
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 set of sensor data per second to a socket server. The socket server will do two things: 1. write data into a file via bsddb; 2. forward the data to a GUI written in wxpython. I am thinking the code should work as follow (not sure it is feasible)...
27
2131
by: cmdolcet69 | last post by:
Can anyone tell me if its possible to do multiple event args in vb.net?
0
10363
Oralloy
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...
0
10172
jinu1996
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...
1
10110
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,...
0
9964
tracyyun
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...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6749
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();...
0
5398
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...
1
4069
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
3
2894
bsmnconsultancy
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...

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.