TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
or nakash
NA
23
0
Asynchronous Sockets - How to get a IP Address of a client and how to block it when needed.
Feb 18 2010 2:54 PM
Hi.
How to get a IP Address of a client? I am currently using this:
public void OnClientConnect(IAsyncResult asyn)
{
try
{
m_socWorker = m_socListener.EndAccept(asyn);
WaitForData(m_socWorker);
m_socListener.BeginAccept(new AsyncCallback(OnClientConnect), null);
AppendText("[" + m_socWorker.RemoteEndPoint.ToString()+ "] Connected.");
}
catch (ObjectDisposedException)
{
System.Diagnostics.Debugger.Log(0, "1", "\n OnClientConnection: Socket has been closed\n");
}
catch (SocketException se)
{
MessageBox.Show(se.Message);
}
}
This code prints the port too and I want it to print only the client's IP Address.
And how to block a IP Address from connecting the server?
Reply
Answers (
1
)
two questions ( about ILMerge and Yahoo Messenger)
C# Keeping Data Changes.