[2nd post] Socket from a channel

  • Thread starter Thread starter Alan Pretre
  • Start date Start date
A

Alan Pretre

Is it possible to get a Socket[1] object at the server from a connected
TcpChannel[2]? What I really want is to get at the RemoteEndpoint[3].

[1] System.Net.Sockets.Socket
[2] System.Runtime.Remoting.Channels.Tcp.TcpChannel
[3] System.Net.EndPoint

-- Alan
 
Alan,

There isn't a mechanism to do this right now. What exactly are you
trying to do? There might be another way to accomplish your goal (through a
message sink perhaps).
 
Nicholas Paldino said:
There isn't a mechanism to do this right now. What exactly are you
trying to do? There might be another way to accomplish your goal (through a
message sink perhaps).

Hi, Nicholas. I'm trying to identify the remote client from the server in
an automatic fashion (IP address). I've seen the sink example in the SDK
and also one from Ingo Rammer but they all manually put the identity in a
call context or ProviderData that needs to be set up at both the client and
server. It appears that if I use the Socket class I can get what I want
automatically without placing a burden on the client. So I was just hoping
I could get a .NET Socket object from a TcpChannel. It looks like I will
have to write a custom client sink and provide it to 3rd parties that desire
to hook up to my server object (not hosted in IIS).

Do you know, is there a technical reason that MS doesn't provide a way to
get a Socket object from a TcpChannel? Seems to me they would be using the
same mechanisms down in the caverns of the code...

-- Alan
 
Back
Top