Board index » delphi » Multiple connections on one server

Multiple connections on one server

hello, I'm going to be making a server side program to interact with a
client program. I'm using the NMMsg component mainly for data transfers.
I'm planning on having multiple simultaneous connections to the server.
The plan was for the client to initially connect to one port and then
the server would tell the client to recconect using another port that
the server had freed up. This way each separate connection will have
it's own port and no data screw-up should occur... hopefully. What I
need to know is how to build a new instance of a NMMsgServ which
contains the data of the original, and then I need to be able to remove
this instance when the connection is closed. Basically, what do I have
to ask for when creating a new component at runtime?

many thanks for your help

-loic

 

Re:Multiple connections on one server


Hi,
You are going about it all wrong.. There wont be any data{*word*222}up with just
one listening Port. This is the way its done.. A socket is unique becuase 4
elements combined..

Client Port
Client Address
Server Port
Server Address

This is how a server keeps its data straight. So, to create two instances is
a lot of work for nothing.. Also, dont use the NM components , they stink.
Use Indy instead. They are free.

Gordon Hamm

Quote
"Loic" <loic_...@hotmail.com> wrote in message

news:3e47f022@newsgroups.borland.com...
Quote

> hello, I'm going to be making a server side program to interact with a
> client program. I'm using the NMMsg component mainly for data transfers.
> I'm planning on having multiple simultaneous connections to the server.
> The plan was for the client to initially connect to one port and then
> the server would tell the client to recconect using another port that
> the server had freed up. This way each separate connection will have
> it's own port and no data screw-up should occur... hopefully. What I
> need to know is how to build a new instance of a NMMsgServ which
> contains the data of the original, and then I need to be able to remove
> this instance when the connection is closed. Basically, what do I have
> to ask for when creating a new component at runtime?

> many thanks for your help

> -loic

Re:Multiple connections on one server


ok, but will this be able to cope if say, 10 people all simultaneously tried
to connect to the server?
I understand how each is unique, but wouldn't I need a new instance of the
server component to listen on that port? if not, how is it possible to have
a server listen on multiple ports?
Why is it NM components stink?
thanks for all of your help, and apologies for the thousand questions,
-loic

Quote
"gordon" <gor...@yabin.com> wrote in message

news:3e4823ed$1@newsgroups.borland.com...
Quote
> Hi,
> You are going about it all wrong.. There wont be any data{*word*222}up with
just
> one listening Port. This is the way its done.. A socket is unique becuase
4
> elements combined..

> Client Port
> Client Address
> Server Port
> Server Address

> This is how a server keeps its data straight. So, to create two instances
is
> a lot of work for nothing.. Also, dont use the NM components , they stink.
> Use Indy instead. They are free.

> Gordon Hamm

> "Loic" <loic_...@hotmail.com> wrote in message
> news:3e47f022@newsgroups.borland.com...

> > hello, I'm going to be making a server side program to interact with a
> > client program. I'm using the NMMsg component mainly for data transfers.
> > I'm planning on having multiple simultaneous connections to the server.
> > The plan was for the client to initially connect to one port and then
> > the server would tell the client to recconect using another port that
> > the server had freed up. This way each separate connection will have
> > it's own port and no data screw-up should occur... hopefully. What I
> > need to know is how to build a new instance of a NMMsgServ which
> > contains the data of the original, and then I need to be able to remove
> > this instance when the connection is closed. Basically, what do I have
> > to ask for when creating a new component at runtime?

> > many thanks for your help

> > -loic

Re:Multiple connections on one server


On Tue, 11 Feb 2003 15:12:15 -0000, "Loic" <loic_...@hotmail.com>
wrote:

Quote
>ok, but will this be able to cope if say, 10 people all simultaneously tried
>to connect to the server?

Yes.

Quote
>I understand how each is unique, but wouldn't I need a new instance of the
>server component to listen on that port? if not, how is it possible to have

If you want to keep the idea with the new ports, you'll need multiple
instances. However, you might consider skipping that plan altogether.
All clients connect to one server listening on one port.

Quote
>Why is it NM components stink?

Well, let's put it this way:
Fastnet comps are buggy and you don't get source codes or support to
change that.
Indy is freeware and open source, so that's a better way to go.
If you want to keep non-blocking sockets (like FastNet), you can also
use ICS (also free and open source).

Andy

Other Threads