Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 22nd, 2004, 10:01 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
Reply With Quote
  #2 (permalink)  
Old August 22nd, 2004, 10:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #3 (permalink)  
Old August 22nd, 2004, 10:30 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old August 22nd, 2004, 10:36 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Reply With Quote
  #5 (permalink)  
Old August 22nd, 2004, 11:07 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you, follow up:

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
access of Items[""] collection in Httphandler anujrathi ASP.NET 2.0 Professional 0 November 15th, 2007 08:02 AM
Maximum limit for a TCP/IP Port ashu_from_india General .NET 2 April 20th, 2006 12:15 AM
TCP/IP HELP jpsultana VB.NET 2002/2003 Basics 0 September 29th, 2005 01:37 PM
HttpHandler, TCP Port ? dotnetMe General .NET 0 August 22nd, 2004 11:01 AM



All times are GMT -4. The time now is 11:41 AM.


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