ASP页面的TCP套接字连接 [英] TCP socket connection from ASP page

查看:191
本文介绍了ASP页面的TCP套接字连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个可以连接到TCP侦听器并向其发送一些

数据的asp页面。

我已经完成了一些编码并且能够发送数据给听众,但仅限

一次。

一旦传输结束,收听者的状态就会进入

close_wait在下一页提交它'没有连接它

了。

如何在提交页面时连接到监听器?


感谢您的帮助。

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.

推荐答案

您使用什么组件进行连接?


你是说你需要连接从页面点击持续到页面

命中同一个会话?或者从所有

会话中的所有用户的页面点击到页面点击?


*可能*您可以将组件对象存储在会话或应用程序中/>
变量。这有多糟糕取决于您的ActiveX

对象的实现情况。如果它是公寓线程,它将被证明是一个瓶颈,

,特别是在负载很重的系统中。如果它是免费的线程,它可能会工作

就好了。


期望TCP连接在页面命中之间存活......可能会发生这种情况
15或20分钟......在任何情况下都可能不是最好的策略。也许你

真的应该建立连接并每次都把它拆掉。或者你可能需要完全考虑不同的实现(例如,Web服务?)。
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?).


让我们关注一个会话/一个用户。

我不希望连接生存下去。我想连接到一个列表器

来自asp页面

每次点击,发送数据给它(听众),这就是全部。


" Old Pedant" < Ol ******* @ discussion.microsoft.com写信息

news:81 ********************* ************* @ microsof t.com ...
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" <Ol*******@discussions.microsoft.comwrote in message
news:81**********************************@microsof t.com...

你用什么组件来建立连接?


你是说你需要连接才能从页面点击持续到

页面

点击同一个会话?或者从页面点击到页面点击为所有用户点击

所有

会话?


*可能*你可以存储组件会话中的对象或

应用程序

变量。这有多糟糕取决于您的ActiveX

对象的实现情况。如果它是公寓线程,它将被证明是一个瓶颈,

,特别是在负载很重的系统中。如果它是免费的线程,它可能是

工作

就好了。


期望TCP连接在页面命中之间存活。 ..

出现

相隔15或20分钟......在任何情况下都可能不是最好的策略。也许



真的应该建立连接并每次都把它拆掉。或许



应该考虑一个不同的实现(例如,一个Web

服务?)。

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



好的,听起来不错。


那么为什么现在不行?你是说你无法与同一个插座进行第二次连接吗?可能是因为第一个

连接永远不会关闭?


并且您没有说明您正在使用哪个组件来执行此操作。它是一个商业版吗?或者你自己推出了吗?


曾经有一个来自ServerObjects.com的非常通用的套接字组件

但他们似乎已经撤回了它。只有我找到的是:
http:// www .aspin.com / home / components / internet / winsockf

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


这篇关于ASP页面的TCP套接字连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆