本文整理汇总了VB.NET中System.Net.Sockets.NetworkStream.Socket属性的典型用法代码示例。如果您正苦于以下问题:VB.NET NetworkStream.Socket属性的具体用法?VB.NET NetworkStream.Socket怎么用?VB.NET NetworkStream.Socket使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Net.Sockets.NetworkStream
的用法示例。
在下文中一共展示了NetworkStream.Socket属性的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