473,396 Members | 1,724 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,396 software developers and data experts.

Socket Pools?

Is there any tutorials or documentation that you could point me towards
regarding pooling requests for a limited number of sockets?

I want users of this class to be able to request a socket and if one isn't
available, their request will be queued and a socket returned when it is
available. Consequently, if a socket is no longer in use, how to return it
to the pool. This is all in an attempt to not make so many connections to a
particular port, but use one if it has already been established.

Does anybody know what I'm talking about?

Any help is appreciated.

Thanks,
Jacob
Nov 16 '05 #1
7 7162
I would have a look at threading to control the sockets.
Get the users to use a UDP Port to request a Connection, when this
connection is successful send back a UDP Message withthe connection detail
for a TCP Port to connect to (Also Send a Hash value say the IP Address and
port as well as some secret Code, to be used to verify that the incomming
connection is allowed to connect at this time)
"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
Is there any tutorials or documentation that you could point me towards
regarding pooling requests for a limited number of sockets?

I want users of this class to be able to request a socket and if one isn't
available, their request will be queued and a socket returned when it is
available. Consequently, if a socket is no longer in use, how to return it
to the pool. This is all in an attempt to not make so many connections to a particular port, but use one if it has already been established.

Does anybody know what I'm talking about?

Any help is appreciated.

Thanks,
Jacob

Nov 16 '05 #2
Almost but not really. You talkin about clients sending requests or a
server that listens for incomming socket connections?
--
wjs mvp

"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
Is there any tutorials or documentation that you could point me towards
regarding pooling requests for a limited number of sockets?

I want users of this class to be able to request a socket and if one isn't
available, their request will be queued and a socket returned when it is
available. Consequently, if a socket is no longer in use, how to return it
to the pool. This is all in an attempt to not make so many connections to a particular port, but use one if it has already been established.

Does anybody know what I'm talking about?

Any help is appreciated.

Thanks,
Jacob

Nov 16 '05 #3
Clients sending requests....

Just looking for a really smart way to manage the requests/sockets. (If the
analogy helps, think of it like a SQL connection pool, but for sockets).

Thanks,
Jacob

"William Stacey [MVP]" <st*****@mvps.org> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Almost but not really. You talkin about clients sending requests or a
server that listens for incomming socket connections?
--
wjs mvp

"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
Is there any tutorials or documentation that you could point me towards
regarding pooling requests for a limited number of sockets?

I want users of this class to be able to request a socket and if one isn't available, their request will be queued and a socket returned when it is
available. Consequently, if a socket is no longer in use, how to return it to the pool. This is all in an attempt to not make so many connections
to a
particular port, but use one if it has already been established.

Does anybody know what I'm talking about?

Any help is appreciated.

Thanks,
Jacob


Nov 16 '05 #4
Jacob,

Check out this article
http://www.devarticles.com/c/a/C-Sha...asses--Part-I/

Mark

On Sun, 8 Aug 2004 00:55:00 -0700, "Jacob" <js@hotmail.com> wrote:
Clients sending requests....

Just looking for a really smart way to manage the requests/sockets. (If the
analogy helps, think of it like a SQL connection pool, but for sockets).

Thanks,
Jacob

"William Stacey [MVP]" <st*****@mvps.org> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Almost but not really. You talkin about clients sending requests or a
server that listens for incomming socket connections?
--
wjs mvp

"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
> Is there any tutorials or documentation that you could point me towards
> regarding pooling requests for a limited number of sockets?
>
> I want users of this class to be able to request a socket and if oneisn't > available, their request will be queued and a socket returned when it is
> available. Consequently, if a socket is no longer in use, how to returnit > to the pool. This is all in an attempt to not make so many connections

to
a
> particular port, but use one if it has already been established.
>
> Does anybody know what I'm talking about?
>
> Any help is appreciated.
>
> Thanks,
> Jacob
>
>



Nov 16 '05 #5
Thanks for the link... a good refresher on .Net sockets, but nothing new,...
or more importantly, nothing to help me in the direction I'm going. Perhaps
I'm not explaining it well. Let me put it in an example.

Say I'm connecting to an HTTP server on port 80. The server allows me a
maximum of two connections, but I have a rich client that could want to
interrupt any of the current connections, use them, and then return them to
what they were doing already. The easy way would be to terminate connections
and connect on each request, but I'm trying to improve efficiency by
creating a socket abstraction layer so that when I pass a connection to
something else, it will think that a connection was just made when in
reality, it's an already established connection. And consequently, when
whatever is using that connection calls Close, it will actually just go back
to the pool.

Any help would be appreciated.

Thanks,
Jacob
"Mark Rees" <ma*******@paradise.net> wrote in message
news:8i********************************@4ax.com...
Jacob,

Check out this article
http://www.devarticles.com/c/a/C-Sha...asses--Part-I/
Mark

On Sun, 8 Aug 2004 00:55:00 -0700, "Jacob" <js@hotmail.com> wrote:
Clients sending requests....

Just looking for a really smart way to manage the requests/sockets. (If theanalogy helps, think of it like a SQL connection pool, but for sockets).

Thanks,
Jacob

"William Stacey [MVP]" <st*****@mvps.org> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Almost but not really. You talkin about clients sending requests or a
server that listens for incomming socket connections?
--
wjs mvp

"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
> Is there any tutorials or documentation that you could point me towards > regarding pooling requests for a limited number of sockets?
>
> I want users of this class to be able to request a socket and if one

isn't
> available, their request will be queued and a socket returned when it is > available. Consequently, if a socket is no longer in use, how to
returnit
> to the pool. This is all in an attempt to not make so many
connectionsto
a
> particular port, but use one if it has already been established.
>
> Does anybody know what I'm talking about?
>
> Any help is appreciated.
>
> Thanks,
> Jacob
>
>

Nov 16 '05 #6
What I'm looking for is actually someting like this, but for a socket
connection:

http://msdn.microsoft.com/library/de...taprovider.asp
Thanks,
Jacob

"Glenn Wilson" <ir****@hotemail.com> wrote in message
news:uG****************@TK2MSFTNGP11.phx.gbl...
I would have a look at threading to control the sockets.
Get the users to use a UDP Port to request a Connection, when this
connection is successful send back a UDP Message withthe connection detail
for a TCP Port to connect to (Also Send a Hash value say the IP Address and port as well as some secret Code, to be used to verify that the incomming
connection is allowed to connect at this time)
"Jacob" <js@hotmail.com> wrote in message
news:6ndRc.4869$Lj.426@fed1read03...
Is there any tutorials or documentation that you could point me towards
regarding pooling requests for a limited number of sockets?

I want users of this class to be able to request a socket and if one isn't available, their request will be queued and a socket returned when it is
available. Consequently, if a socket is no longer in use, how to return it to the pool. This is all in an attempt to not make so many connections
to a
particular port, but use one if it has already been established.

Does anybody know what I'm talking about?

Any help is appreciated.

Thanks,
Jacob


Nov 16 '05 #7
Have two initial swags at this (if I understand your requirements)
1) Create a pool object. This object will contain two (or more) connection
objects that abstract a socket and they will keep their socket open. Use a
semaphore with a count of 2 to protect the number of owning connection
objects that can be out at any one time. More requests will just block
until someone that owns a connection object closes it. When closed, the
connection object will release 1 semaphore to add it back to the pool.

2) Abstract connection at a higher level. Have one connection object and a
C-queue that client object can put requests into. The connection object
then just services the queue and you figure out who to send reply back to -
maybe another reply queue for each client.

--
William Stacey, MVP

"Jacob" <js@hotmail.com> wrote in message
news:w3BRc.5961$Lj.440@fed1read03...
Thanks for the link... a good refresher on .Net sockets, but nothing new,... or more importantly, nothing to help me in the direction I'm going. Perhaps I'm not explaining it well. Let me put it in an example.

Say I'm connecting to an HTTP server on port 80. The server allows me a
maximum of two connections, but I have a rich client that could want to
interrupt any of the current connections, use them, and then return them to what they were doing already. The easy way would be to terminate connections and connect on each request, but I'm trying to improve efficiency by
creating a socket abstraction layer so that when I pass a connection to
something else, it will think that a connection was just made when in
reality, it's an already established connection. And consequently, when
whatever is using that connection calls Close, it will actually just go back to the pool.

Any help would be appreciated.

Thanks,
Jacob
"Mark Rees" <ma*******@paradise.net> wrote in message
news:8i********************************@4ax.com...
Jacob,

Check out this article

http://www.devarticles.com/c/a/C-Sha...asses--Part-I/

Mark

On Sun, 8 Aug 2004 00:55:00 -0700, "Jacob" <js@hotmail.com> wrote:
Clients sending requests....

Just looking for a really smart way to manage the requests/sockets. (If the
analogy helps, think of it like a SQL connection pool, but for
sockets).
Thanks,
Jacob

"William Stacey [MVP]" <st*****@mvps.org> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
> Almost but not really. You talkin about clients sending requests or a> server that listens for incomming socket connections?
> --
> wjs mvp
>
> "Jacob" <js@hotmail.com> wrote in message
> news:6ndRc.4869$Lj.426@fed1read03...
> > Is there any tutorials or documentation that you could point me
towards> > regarding pooling requests for a limited number of sockets?
> >
> > I want users of this class to be able to request a socket and if oneisn't
> > available, their request will be queued and a socket returned when
it is> > available. Consequently, if a socket is no longer in use, how to returnit
> > to the pool. This is all in an attempt to not make so many connectionsto
> a
> > particular port, but use one if it has already been established.
> >
> > Does anybody know what I'm talking about?
> >
> > Any help is appreciated.
> >
> > Thanks,
> > Jacob
> >
> >
>
>


Nov 16 '05 #8

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

Similar topics

7
by: David Sworder | last post by:
Hi, I'm developing an application that will support several thousand simultaneous connections on the server-side. I'm trying to maximize throughput. The client (WinForms) and server communicate...
1
by: dreamlinetheater | last post by:
I have several sites running on Windows 2003 Server in true IIS 6 mode with Application pools. One site has about 9 Virtual Directories in it that are all configured to run as applications. Each...
1
by: Gordon Smith | last post by:
I plan to install multiple Web applications installed on a single Web server. Should I create each Web site in its own Application pool? I'd appreciate any recommendations, guidelines or links to...
1
by: dm1608 | last post by:
Hi, all. I have a question regarding ASP.NET and Application Pools as defined within IIS Manager. I have a bunch of in-house ASP.NET applications that I frequently have to install on my IIS 6...
4
by: Diffident | last post by:
Hello All, IIS 6.0 - I have an application which resides in its own application pool. Does anyone know if we can create multiple application pools for the same application? If we can create...
2
by: Cameron.39 | last post by:
Hello, I am currently running into a bug where I have two applications on the same machine, using the same Identity, for the same web site. One application (App1) accesses the other application...
1
by: richard.hallgren | last post by:
Hi, I have some questions concerning thread pools. I've marked the questions by number in the text. First I'd like to know when which thread pools an application uses. I know ASP.NET uses the...
15
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast...
6
by: Pat B | last post by:
Hi, I'm writing my own implementation of the Gnutella P2P protocol using C#. I have implemented it using BeginReceive and EndReceive calls so as not to block when waiting for data from the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.