Name
TcpListener
Synopsis
This class provides a server-side abstraction of the sockets API. The TcpListener
is constructed with a
local address and port to which it is automatically bound. A call to Start()
initiates
listening for connection requests. When a request is received, either AcceptSocket()
or AcceptTcpClient()
accepts
the connection and returns a Socket
or a TcpClient
you can use to exchange data with the remote.
Public Class TcpListener ' Public Constructors Public Sub New( ByVal port As Integer) Public Sub New(ByVal localaddr As System.Net.IPAddress, ByVal port As Integer) Public Sub New( ByVal localEP As System.Net.IPEndPoint) ' Public Instance Properties Public ReadOnly Property LocalEndpoint As EndPoint ' Protected Instance Properties Protected Property Active As Boolean Protected Property Server As Socket ' Public Instance Methods Public Function AcceptSocket() As Socket Public Function AcceptTcpClient() As TcpClient Public Function Pending() As Boolean Public Sub Start() Public Sub Stop() ' Protected Instance Methods Overrides Protected Sub Finalize() End Class
Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.