本文整理匯總了VB.NET中System.Net.Sockets.NetworkStream.Readable屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET NetworkStream.Readable屬性的具體用法?VB.NET NetworkStream.Readable怎麽用?VB.NET NetworkStream.Readable使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Net.Sockets.NetworkStream
的用法示例。
在下文中一共展示了NetworkStream.Readable屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: MyNetworkStream_Sub_Class
Public Class MyNetworkStream_Sub_Class
Inherits NetworkStream
Public Sub New(socket As Socket, ownsSocket As Boolean)
MyBase.New(socket, ownsSocket)
End Sub
' Suppose you wanted a property for determining if Socket is connected. You can use
' the protected method 'Socket' to return underlying Socket.
Public ReadOnly Property IsConnected() As Boolean
Get
Return Me.Socket.Connected
End Get
End Property
' You could also use public NetworkStream methods 'CanRead' and 'CanWrite'.
Public ReadOnly Property CanCommunicate() As Boolean
Get
If Not Me.Readable Or Not Me.Writeable Then
Return False
Else
Return True
End If
End Get
End Property
Public Shared Sub DoSomethingSignificant()
End Sub
' Do something significant in here