p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Classic ASP Professional (http://p2p.wrox.com/forumdisplay.php?f=63)
-   -   HttpHandler, TCP Port ? (http://p2p.wrox.com/showthread.php?t=17234)

dotnetMe August 22nd, 2004 10:01 AM

HttpHandler, TCP Port ?
 
Hi everyone,
I have a HttpHandler in wich I need to know the tcp source port of the request. As much as I figured out I need to access the HttpWorkerRequest.GetRemotePort() .
I made several attempts but everytime it returns 0.

first try:

void IHttpHandler.ProcessRequest(HttpContext context)
{
BindingFlags _WorkerBinding =BindingFlags.Instance|BindingFlags.Public|Binding Flags.NonPublic;
HttpWorkerRequest _WorkerRequest = (HttpWorkerRequest)
context.GetType().GetProperty("WorkerRequest",
_WorkerBinding).GetValue(context, null);

int _ReqTcpPort = _WorkerRequest.GetRemotePort();
...
}

second try:

void IHttpHandler.ProcessRequest(HttpContext context)
{
IServiceProvider _Provider = (IServiceProvider) context;
HttpWorkerRequest _WorkerRequest =
(HttpWorkerRequest) _Provider.GetService(typeof(HttpWorkerRequest));

int _ReqTcpPort = _WorkerRequest.GetRemotePort();
...
}

how can I get access to the properties (tcp source port) of the underlying connection ???

thanks in advance,

Martin

happygv August 22nd, 2004 10:12 AM

Doesn't look like classic ASP related. Should that be posted in a relavant forum?

_________________________
- Vijay G
Strive for Perfection

dotnetMe August 22nd, 2004 10:30 AM

If you know one where someone can help me better :)


happygv August 22nd, 2004 10:36 AM

If .Net related, you can choose the best fit from this category Dotnet

If C# related, you post on the best fit forum under this category C

Cheers!

_________________________
- Vijay G
Strive for Perfection

dotnetMe August 22nd, 2004 11:07 AM

thank you, follow up:

http://p2p.wrox.com/topic.asp?TOPIC_ID=17968



All times are GMT -4. The time now is 04:51 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.