473,772 Members | 2,564 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 3634
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
4997
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
7570
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
4770
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
9621
marktang
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...
0
10106
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...
0
9914
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...
1
7461
isladogs
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...
0
6716
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
5355
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...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
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
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.