Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

System.Net.Sockets.Tcplistener  :: Explained

Posted on 2004-10-17
3
Medium Priority
?
622 Views
Last Modified: 2011-10-03
Can someone please explain System.Net.Sockets.Tcplistener for me ?
0
Comment
Question by:addicktz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
KarcOrigin earned 1050 total points
ID: 12336306
Hi,
Tcplistener is a class that listen the TCP connetions. If you have work with WinSocket control this class behaves like a that. It listen and accept incoming connection requests. You can initiate this class by providing IP address and the port number. If you do not know the IP address of the machine on which you are initiating this class you can also use Any keyword.
Example -
Private listener As TcpListener
listener = New TcpListener(System.Net.IPAddress.Any, YourPortNumber)
listener.Start() method will start the listener to listen any incoming request from other TCP clients.
After start listening to the incoming request you have to make a listening loop that will wait and listen any incoming client connection request

While True
  Dim client As TcpClient = server.AcceptTcpClient() ' On this line your code will stop and wait for any incoming client request
  ' Now you can use client (TcpClient) property and methods
  client.GetStream ' This method is perticularly useful to read and send the data to the connected client
  client.Close ' Shutdown and end connection
End While

This is just an overview of Tcplistener class. For more detail explanation please visit to
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetsocketstcplistenerclasstopic.asp
Thanks
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12336309
O..O I was writing my comments in the mean time checoo pops up with the same link!

Caio
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question