473,382 Members | 1,362 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,382 software developers and data experts.

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 18253
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
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...
0
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...
5
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...
1
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...
2
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...
1
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...
0
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...
2
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...
11
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:...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.