473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Getting Remote Address from TCPClient

Ok,

Why is this so hard too do? I have a TCPListener that's working exactly
as expected. It fires off a new thread to listen on calling this function.

================================================== ======================
Private Sub DoListen()
m_oListener.Start()

While True
Dim oClient As TcpClient = m_oListener.AcceptTcpClient

' We got a new connection - get a server for it
Dim oServer As IServer = m_oFactory.GetServer

' *** Want to log the remote IP address and port here ***

oServer.ConnectTo(oClient)

' Add this server to our list to keep it alive
_Servers.Add(oServer)
End While

End Sub
================================================== ======================

Now I need to log the remote IP and port details, but socket is
protected in TCPClient and I can't get to it. I've created my own client
class derived from it, but you can't cast NetworkStream to a derived class.

Any clues or pointers here would be most appreciated!

TIA
Nov 21 '05 #1
0 1361

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephen Remde | last post by:
what the kosher way of vreating a tcp client/server app in .net? can anyone recommend a good in depth tutorial? currently im using a TcpListener but i cant get a remotre address from the...
5
by: Horst Walter | last post by:
What is wrong here? IPAddress ipAddress = IPAddress.Parse("10.10.20.1"); IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, this.port); this.tcpClient = new TcpClient(ipEndPoint); // PROBLEM HERE...
1
by: Ethan | last post by:
Hi, In quite a fix here. Hope someone can help ASAP. I need to get the IP address of the client that connects when I use TcpListener.AcceptTcpConnections. I know I can get the information...
0
by: Johann Blake | last post by:
I am using the TcpClient to connect to a web site. I then open a NetworkStream and read the contents that are being sent back. The problem is that I have no idea when the remote host is finished...
1
by: MuZZy | last post by:
HI, How do i get a remote TcpClient address here? // ======================================= TcpListener l = new TcpListener(IPAddress.Parse("127.0.0.1"), 8080); TcpListener.Start(); While...
1
by: Benny Raymond | last post by:
Is it possible to get the ip address of the pc connecting to my TcpListener? Here's how my code works so far: listener = new TcpListener(_myIP, _port); listener.Start(); // block until we...
1
by: -J | last post by:
When connecting to a server application via a TCP socket connection, how do I retrieve the IP Address of the client computer that is making the connection. I create and IPEndPoint for the client,...
4
by: anonymous_c | last post by:
Hey guys. I'm creating a file transfer app. Anyways, I'm using this code... SERVER <code>Dim Hostname As String = Dns.GetHostName Dim IP As String =...
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.