0

Is it possible to obtain the socket from which an http request was made within c#?

Any direction would be greatly appreciated!

Matthew

Matthew
  • 411
  • 4
  • 14
  • What do you intend to do with that `Socket`? You can force HttpWebRequest to use a particular local endpoint but I don't think you can get the actual `Socket`. See http://stackoverflow.com/questions/5515000/choosing-which-ip-the-http-request-is-using-when-having-multiple-ips-net – Ilian Dec 14 '11 at 03:35
  • We have cameras which send an alive signal out through a firewall. We need to able to hold onto the socket the alive signal came in on. We can then send cgi commands down that socket and have a conversation like that. – Matthew Dec 14 '11 at 20:16

1 Answers1

0

Not with the HttpWebRequest class, but you can create a socket and manage the HTTP yourself. Not a great option I know but it is the best I've been able to find.

M.Babcock
  • 18,753
  • 6
  • 54
  • 84