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
Solved

System.Net.Sockets.Tcplistener  :: Explained

Posted on 2004-10-17
3
609 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 (3.5 Framework) Remove all items from List 3 32
VB.net and sql server 4 45
How to limit User Input 2 27
VB.NET Textbox input validation 4 40
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

837 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