Solved

System.Net.Sockets.Tcplistener  :: Explained

Posted on 2004-10-17
3
605 Views
Last Modified: 2011-10-03
Can someone please explain System.Net.Sockets.Tcplistener for me ?
0
Comment
Question by:addicktz
  • 2
3 Comments
 
LVL 9

Expert Comment

by:checoo
ID: 12336292
0
 
LVL 5

Accepted Solution

by:
KarcOrigin earned 350 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now