Sockets: Multiple Clients, One port



From: "Factor" <jasonsgeiger@xxxxxxxxx>
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 it can start listening on that port again for other clients
and starts a new thread that contacts the client back on some random
outgoing server port. Maybe this seems stupid, but at the time we
thought there was no way to have multiple connections on one port at a
time.

Then we started thinking about it. FTP, SMTP. These all operate on
standard ports and handle multiple simultanious clients/connections.
How is this done? My curiosity never peek enough to actually try to
code it.

Fortunately/Unfortunately, the time has come for me to impliment
something like this - not because I'm just curious - but because the
clients are soon be heavily firewalled and I will not be able to have
the server "contact them back" like we are doing now. I have to figure
out how to get the clients to log into this port on the server, and not
block out all other clients while they are communicating. Sessions are
often only a few seconds long but they CAN be up to an hour (we're
doing work over the cellular network, it's very slow and roundtrip
latency cane be up to two seconds! Yikes!) If I have a client logged
in for 45 minutes it cannot be blocking that port for all other clients
for that time.

So to my question: Am I attempting the impossible? How do I go about
doing this? Does anyone know of any resources that I can read online
or purchase(books, CDs) to help me get started with this multiple
clients on one port application? Am I incorrect about thinking that
one port can handle more than one connection (if so, then how does
SMTP, POP3, FTP, or any other common port server function)?

I've found very little out there on the internet... anyone have any
sugestions?
I can post cost if necessary, but since I'm really looking for help on
new nonexistant code, then I'm not sure what good it would do anyone.

I thank you all ahead of time for any help I receive. Thank you for you
time,

Jason

P.S. I know I can come up with some scheme that the client logs in and
then i send it back a port number from a known pool on my server. Then
the client can log out and then log back into that port. This seems
Sockets: messy and unnecessary. It'd rather try to make it work all on
one port.

.



Relevant Pages

  • RE: Printing from Win9x clients stops
    ... > and make sure this software does not interfere with SBS Server. ... > clients, please disable it and try again. ... Create a local printer and redirect the port to the network server. ...
    (microsoft.public.windows.server.sbs)
  • Re: network programming: how does s.accept() work?
    ... The program you contact at Google is a server. ... so, the server will usually assign a new port, say 56399, specifically ... connections to a server remain on the same port, ... sockets is what identifies them. ...
    (comp.lang.python)
  • Re: Apache webserver outage - need help with forensics
    ... Bob Brennan wrote: ... > I have a server which went completely unresponsive today on port 80 ... How many clients is your server configured to handle simultaneously? ... clients communications stuck and no new client connections could be accepted. ...
    (Fedora)
  • RE: Web Services or Sockets?
    ... different companies with addresses from a DHCP server. ... it listen to a port on the client computer? ... I don't know how these two examples with clients over the internet. ... >> If the client is listening to a port, but is sitting behind a firewall, how ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Socket switch delay
    ... hadn't realized the bit about the completion port... ... > can come back with partial buffers from a completion io. ... > in the client and server. ... > remember changing in the server was the "non-blocking sockets" together ...
    (microsoft.public.win32.programmer.networks)