Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

TCP socket connection from ASP page

Question posted by: User Groups (Guest) on July 17th, 2008 01:05 AM
I want to have an asp page that can connect to a TCP listener and send some
data to it.
I have done some coding and was able to send data to the listener but for
one time only.
As soon as a transmission is over a status of the listener goes into
close_wait and at the next page submit it's not getting connected to it
anymore.
How can I get connected to the listener avery time a page is submitted?

Thanks for help.


Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 17th, 2008
01:05 AM
#2

Re: TCP socket connection from ASP page
What component are you using to make the connection??

And are you saying you need the connection to persist from page hit to page
hit for the same session? Or from page hit to page hit for all users in all
sessions?

*POSSIBLY* you could store the component object in a Session or Application
variable. How bad that is depends on how well implemented your ActiveX
object is. If it is apartment threaded, it will prove to be a bottleneck,
especially in a heavily loaded system. If it is free threaded, it might work
just fine.

Expecting a TCP connection to survive between page hits...which might occur
15 or 20 minutes apart...may not be the best strategy in any case. Maybe you
really should set up the connection and tear it down each time. Or maybe you
should consider a different implementation altogether (e.g., a Web Service?).



User Groups's Avatar
User Groups
Guest
n/a Posts
July 17th, 2008
01:05 AM
#3

Re: TCP socket connection from ASP page
Let's focus on one session/one user.
I dont want aconnection to survive at all. I want to connect to a listner
from asp page
on every hit, send data to it (listener), and that's all.

"Old Pedant" <OldPedant@discussions.microsoft.comwrote in message
news:81490458-2674-4C08-9FE0-504D06A47419@microsoft.com...
Quote:
Originally Posted by
What component are you using to make the connection??
>
And are you saying you need the connection to persist from page hit to
page
hit for the same session? Or from page hit to page hit for all users in
all
sessions?
>
*POSSIBLY* you could store the component object in a Session or
Application
variable. How bad that is depends on how well implemented your ActiveX
object is. If it is apartment threaded, it will prove to be a bottleneck,
especially in a heavily loaded system. If it is free threaded, it might
work
just fine.
>
Expecting a TCP connection to survive between page hits...which might
occur
15 or 20 minutes apart...may not be the best strategy in any case. Maybe
you
really should set up the connection and tear it down each time. Or maybe
you
should consider a different implementation altogether (e.g., a Web
Service?).
>
>




=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 17th, 2008
01:45 AM
#4

Re: TCP socket connection from ASP page
Okay, that sounds good.

So why isn't that working now??? Are you saying that you are unable to make
a second connection to the same socket? Possibly because the first
connection never go closed?

And you didn't say what component you are using to do this with. Is it a
commercial one or did you roll your own?

There used to be a pretty generic sockets component from ServerObjects.com
but they seem to have withdrawn it. Only ones I find are these:
http://www.aspin.com/home/components/internet/winsockf


User Groups's Avatar
User Groups
Guest
n/a Posts
July 17th, 2008
01:55 AM
#5

Re: TCP socket connection from ASP page
<Are you saying that you are unable to make
< a second connection to the same socket
Exactly. Because the listener goes into close_wait and no connection can be
done to it.
I am using Winsock ActiveX control.


"Old Pedant" <OldPedant@discussions.microsoft.comwrote in message
news:E26C847B-F0AF-488C-A8D1-CB8AD81B208C@microsoft.com...
Quote:
Originally Posted by
Okay, that sounds good.
>
So why isn't that working now??? Are you saying that you are unable to
make
a second connection to the same socket? Possibly because the first
connection never go closed?
>
And you didn't say what component you are using to do this with. Is it a
commercial one or did you roll your own?
>
There used to be a pretty generic sockets component from ServerObjects.com
but they seem to have withdrawn it. Only ones I find are these:
http://www.aspin.com/home/components/internet/winsockf
>




=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 17th, 2008
02:15 AM
#6

Re: TCP socket connection from ASP page
Exactly. Because the listener goes into close_wait and no connection can be
Quote:
Originally Posted by
done to it.
I am using Winsock ActiveX control.


Gotcha. Sorry. Never used this. You'd think it would work, being from MS,
but....

I'm *assuming* it goes into close_wait when you attempt to close the
connection, no? Or do you mean it does so before you attempt the close?
Ehhh...not that I would know how to fix either condition. Sorry.

May be time to abandon this control and find another wone to use??





User Groups's Avatar
User Groups
Guest
n/a Posts
July 17th, 2008
02:25 AM
#7

Re: TCP socket connection from ASP page
I am not entirely sure it's because of a control I am using.
I tried to close connection after data has been sent or leave it and let it
die because of an asp page life cicle. Same.
"Old Pedant" <OldPedant@discussions.microsoft.comwrote in message
news:8D186FFE-7E30-4937-ABEC-074E8A83190A@microsoft.com...
Quote:
Originally Posted by
Quote:
Originally Posted by
>Exactly. Because the listener goes into close_wait and no connection can
>be
>done to it.
>I am using Winsock ActiveX control.

>
Gotcha. Sorry. Never used this. You'd think it would work, being from
MS,
but....
>
I'm *assuming* it goes into close_wait when you attempt to close the
connection, no? Or do you mean it does so before you attempt the close?
Ehhh...not that I would know how to fix either condition. Sorry.
>
May be time to abandon this control and find another wone to use??
>
>
>
>




p byers's Avatar
p byers
Guest
n/a Posts
July 18th, 2008
06:05 AM
#8

Re: TCP socket connection from ASP page
Good Morning
I am presuming that this technology allows the "Client" to find and go
directly to the desired IP address rather than being routed via several
intermediate IP addresses.

Would someone please have the time, energy and inclination to outline the
Pro's and Con's of such a Technique ??

Thanks
Pete (Northolt UK)

Old Pedant wrote:
Quote:
Originally Posted by
Okay, that sounds good.
>
So why isn't that working now??? Are you saying that you are unable to make
a second connection to the same socket? Possibly because the first
connection never go closed?
>
And you didn't say what component you are using to do this with. Is it a
commercial one or did you roll your own?
>
There used to be a pretty generic sockets component from ServerObjects.com
but they seem to have withdrawn it. Only ones I find are these:
http://www.aspin.com/home/components/internet/winsockf



Evertjan.'s Avatar
Evertjan.
Guest
n/a Posts
July 18th, 2008
07:55 AM
#9

Re: TCP socket connection from ASP page
p byers wrote on 18 jul 2008 in microsoft.public.inetserver.asp.general:
Quote:
Originally Posted by
Old Pedant wrote:
>
Quote:
Originally Posted by
>Okay, that sounds good.
>>
>So why isn't that working now??? Are you saying that you are unable
>to make a second connection to the same socket? Possibly because the
>first connection never go closed?
>>
>And you didn't say what component you are using to do this with. Is
>it a commercial one or did you roll your own?


Could you answer that?
Quote:
Originally Posted by
Quote:
Originally Posted by
>There used to be a pretty generic sockets component from
>ServerObjects.com but they seem to have withdrawn it. Only ones I
>find are these:
>http://www.aspin.com/home/components/internet/winsockf


[Please do not toppost on usenet]
Quote:
Originally Posted by
I am presuming that this technology allows the "Client" to find
and go
directly to the desired IP address rather than being routed via
several intermediate IP addresses.
>
Would someone please have the time, energy and inclination to
outline the Pro's and Con's of such a Technique ??


Seems far off topic for ASP.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 18th, 2008
07:15 PM
#10

Re: TCP socket connection from ASP page
>>And you didn't say what component you are using to do this with. Is
Quote:
Originally Posted by
Quote:
Originally Posted by
Quote:
Originally Posted by
>>it a commercial one or did you roll your own?

Quote:
Originally Posted by
Could you answer that?


He did answer it. He wrote:
"I am using Winsock ActiveX control."

That's a control that comes with MS Office. It's a pretty generic one, as I
read the docs, and requires that the scripter do all the steps himself. The
other commercial ones seem to do a better job of automating the process.
Still, I can't see why the connection would just "hang".

p.s.: You should have explained what "toppost" means. I doubt that many
people use the term any more. Been *years* since I saw it, in fact.



Evertjan.'s Avatar
Evertjan.
Guest
n/a Posts
July 18th, 2008
07:25 PM
#11

Re: TCP socket connection from ASP page
=?Utf-8?B?T2xkIFBlZGFudA==?= wrote on 18 jul 2008 in
microsoft.public.inetserver.asp.general:
Quote:
Originally Posted by
Quote:
Originally Posted by
Quote:
Originally Posted by
>>>And you didn't say what component you are using to do this with. Is
>>>it a commercial one or did you roll your own?

>
Quote:
Originally Posted by
>Could you answer that?

>
He did answer it. He wrote:
"I am using Winsock ActiveX control."


Do you use that on the server in ASP?
Quote:
Originally Posted by
That's a control that comes with MS Office. It's a pretty generic
one, as I read the docs, and requires that the scripter do all the
steps himself. The other commercial ones seem to do a better job of
automating the process. Still, I can't see why the connection would
just "hang".


In ASP?
Quote:
Originally Posted by
p.s.: You should have explained what "toppost" means.


No I should not.
It is in the Netiquestte files of usenet all over the web.
And you seem to undeerstand well.
Quote:
Originally Posted by
I doubt that many people use the term any more.
Been *years* since I saw it, in fact.


You are free to doubt,
but it is used often in this and manuy other NGs.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

=?Utf-8?B?T2xkIFBlZGFudA==?='s Avatar
=?Utf-8?B?T2xkIFBlZGFudA==?=
Guest
n/a Posts
July 18th, 2008
08:45 PM
#12

Re: TCP socket connection from ASP page
"Evertjan." wrote:
Quote:
Originally Posted by
Do you use [Winsock ActiveX control] on the server in ASP?


Sure. Why not?? It's an ActiveX control, meaning it's scriptable. And it
doesn't imply any graphical/window usage (that is, it wasn't intended to be
used only in a windowing environment).
Quote:
Originally Posted by
Quote:
Originally Posted by
>That's a control that comes with MS Office. It's a pretty generic
>one, as I read the docs, and requires that the scripter do all the
>steps himself. The other commercial ones seem to do a better job of
>automating the process. Still, I can't see why the connection would
>just "hang".

Quote:
Originally Posted by
In ASP?


Again, sure. If they are ActiveX controls that don't use windows, then why
couldn't/wouldn't you use them in ASP. Or were you doubting my last
sentence? Implying that the "hang" might be an artifact of using the control
in ASP? If so, that was the point of my suggesting he try some other
control, just in case there is some aspect of that control that doesn't play
well with ASP. Again, no idea what it might be, but why not experiment a
bit? (And with one exception, the list of controls in that URL I pointed him
to all specifically *claim* to be for use with ASP.)
Quote:
Originally Posted by
Quote:
Originally Posted by
p.s.: You should have explained what "toppost" means.

No I should not.


Okay, so maybe I'm more tolerant than you are. Which is mildly funny, since
I've been accused of being a nasty responder in the past. ("Past" including
day before yesterday. <grin/>) I do agree with you, though. I don't like
topposting any place. EMail, forums, whatever. It's a royal pain no matter
where you encounter it.


 
Not the answer you were looking for? Post your question . . .
182,081 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors