473,513 Members | 2,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get TCPClient's IP from TCPListener

zZ
Hi All,

I'm building a TCPListener as the server to accept TCPClient connections,
using

TCPListener.AcceptTcpClient.

I'd like to retrieve client's IP after connected, but found no way to do so.
Is there a walkaround? Thanks for any tip.
Kind regards,
Zen
Jul 21 '05 #1
1 18319
TCPClient tc = TCPListener.AcceptTcpClient();
Socket s = tc.Client;
Console.WriteLine("I am connected to " +
IPAddress.Parse(((IPEndPoint)s.RemoteEndPoint).Add ress.ToString()) +
"on port number " + ((IPEndPoint)s.RemoteEndPoint).Port.ToString());
http://www.freesmtp.net

socket.RemoteEndPoint
"zZ" <zz****@studenten.net> wrote in message
news:3f********@newsreader.concepts.nl...
Hi All,

I'm building a TCPListener as the server to accept TCPClient connections,
using

TCPListener.AcceptTcpClient.

I'd like to retrieve client's IP after connected, but found no way to do so. Is there a walkaround? Thanks for any tip.
Kind regards,
Zen

Jul 21 '05 #2

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

Similar topics

3
9072
by: Daniel | last post by:
TcpClient close() method socket leak when i use TcpClient to open a connection, send data and close the TcpClient with myTcpClientInstance.Close(); it takes 60 seconds for the actual socket on the client machine to close per my network app the computer fills up w/ thousands of these :0 TCP foobox:8888 localhost:2188 TIME_WAIT :0 TCP...
0
1212
by: HelpWithFTP | last post by:
I am writing a small internal application on Windows 2000 using VB.Net. I need to FTP some files from a Unix Server. I have the basic FTP functionality down and can get a list of the files in a certain directory. However, later on in the program, I need to call the List ftp command again. At this point I get an error: "saying 425 Can't build...
5
6119
by: Wal Turner | last post by:
This has been discussed in a prior thread but there was no solution proposed. Also, using WebRequest is not viable since we need a keep-alive connection. Can anyone provide any information on using the TCPClient class (or other) via proxies and whether or not this is possible? Regards Wwal
1
4513
by: hamil | last post by:
I am having trouble using the TcpListener and TcpClient classes. At the end of this post is server code that runs, and a class whose purpose is described below. I need to know when the client closes the connection so I can exit my listener code. Here is what I have tried. First I asked MSDN and they said..
2
4654
by: Dave Coate | last post by:
Hi, I am working on a client-server app. I can get two applications to talk to each other on the same machine using 127.0.0.1, but as soon as I try it using a computer name or actual IP address I get a SocketException: "No connection could be made because the target machine actively refused it". On the server I have a listener: Private...
1
322
by: zZ | last post by:
Hi All, I'm building a TCPListener as the server to accept TCPClient connections, using TCPListener.AcceptTcpClient. I'd like to retrieve client's IP after connected, but found no way to do so. Is there a walkaround? Thanks for any tip.
0
1287
by: den 2005 | last post by:
Hi everybody, I am still learning how sockets, TcpClient and TcpListener work, in order that both sides to send and receive data, both sides must have a socket or TcpListener and a TcpListener right? Is there a possible way to say just have a client side TcpClient application to send a message to remote server like sending a text file? Do...
2
2840
by: Martin Arvidsson | last post by:
Hi! I am just beginning to learn about the TcpListener and TcpClient and Socket. I have figured out the TcpListener, it is used for booth in and outgoing requests, right? But when to use the TcpClient and when to use the Socket? Regards
11
2555
by: batmanfreeze | last post by:
I am using C# in .Net 1.1, and need to access the 'Client' Property of TcpClient, so I created a derived class to do this based upon the Microsoft Sample, located at: http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcpclient.client(VS.71).aspx The only problem is that in my main app, when I try to do the following, I get an Invalid...
0
7559
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7542
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5701
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.