TCP socket connection from ASP page

U

User Groups

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.
 
O

Old Pedant

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?).
 
U

User Groups

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.
 
O

Old Pedant

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
 
U

User Groups

<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.
 
O

Old Pedant

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??
 
U

User Groups

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.
 
P

p byers

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)
 
E

Evertjan.

p byers wrote on 18 jul 2008 in microsoft.public.inetserver.asp.general:
Could you answer that?

[Please do not toppost on usenet]
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.
 
O

Old Pedant

And you didn't say what component you are using to do this with. Is
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.
 
E

Evertjan.

=?Utf-8?B?T2xkIFBlZGFudA==?= wrote on 18 jul 2008 in
microsoft.public.inetserver.asp.general:
He did answer it. He wrote:
"I am using Winsock ActiveX control."

Do you use that on the server in ASP?
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?
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.
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.
 
O

Old Pedant

Evertjan. said:
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).

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.)
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,979
Messages
2,570,185
Members
46,728
Latest member
FernMcmull

Latest Threads

Top