?
Solved

System.Net.Sockets.Tcplistener  :: Explained

Posted on 2004-10-17
3
Medium Priority
?
617 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 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