From 229ec8be6612bf78f3c4e403ff7ddbce952b2b42 Mon Sep 17 00:00:00 2001 From: "Arin(asus)" Date: Sat, 21 Jun 2025 11:42:01 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B0=B1=EC=97=85=ED=8C=8C=EC=9D=BC=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sub/WinsockOracs/Backup/About.txt | 23 - Sub/WinsockOracs/Backup/AsyncSocket.vb | 1247 ----------------- Sub/WinsockOracs/Backup/Deque.vb | 185 --- Sub/WinsockOracs/Backup/Enumerations.vb | 49 - Sub/WinsockOracs/Backup/EventArgs.vb | 422 ------ Sub/WinsockOracs/Backup/History.txt | 28 - Sub/WinsockOracs/Backup/IWinsock.vb | 111 -- .../Backup/My Project/Application.Designer.vb | 13 - .../Backup/My Project/Application.myapp | 10 - .../Backup/My Project/AssemblyInfo.vb | 35 - .../Backup/My Project/Resources.Designer.vb | 70 - .../Backup/My Project/Resources.resx | 124 -- .../Backup/My Project/Settings.Designer.vb | 73 - .../Backup/My Project/Settings.settings | 7 - Sub/WinsockOracs/Backup/ObjectPacker.vb | 53 - .../Backup/Resources/k-koding.png | Bin 30384 -> 0 bytes Sub/WinsockOracs/Backup/SharedMethods.vb | 85 -- Sub/WinsockOracs/Backup/Winsock Orcas.vbproj | 129 -- Sub/WinsockOracs/Backup/Winsock.png | Bin 749 -> 0 bytes Sub/WinsockOracs/Backup/Winsock.vb | 583 -------- Sub/WinsockOracs/Backup/WinsockCollection.vb | 571 -------- Sub/WinsockOracs/Backup/WinsockDesigner.vb | 236 ---- Sub/WinsockOracs/Backup/WinsockFileData.vb | 83 -- Sub/WinsockOracs/Backup/frmAbout.Designer.vb | 146 -- Sub/WinsockOracs/Backup/frmAbout.resx | 149 -- Sub/WinsockOracs/Backup/frmAbout.vb | 24 - Sub/WinsockOracs/UpgradeLog.htm | 299 ---- 27 files changed, 4755 deletions(-) delete mode 100644 Sub/WinsockOracs/Backup/About.txt delete mode 100644 Sub/WinsockOracs/Backup/AsyncSocket.vb delete mode 100644 Sub/WinsockOracs/Backup/Deque.vb delete mode 100644 Sub/WinsockOracs/Backup/Enumerations.vb delete mode 100644 Sub/WinsockOracs/Backup/EventArgs.vb delete mode 100644 Sub/WinsockOracs/Backup/History.txt delete mode 100644 Sub/WinsockOracs/Backup/IWinsock.vb delete mode 100644 Sub/WinsockOracs/Backup/My Project/Application.Designer.vb delete mode 100644 Sub/WinsockOracs/Backup/My Project/Application.myapp delete mode 100644 Sub/WinsockOracs/Backup/My Project/AssemblyInfo.vb delete mode 100644 Sub/WinsockOracs/Backup/My Project/Resources.Designer.vb delete mode 100644 Sub/WinsockOracs/Backup/My Project/Resources.resx delete mode 100644 Sub/WinsockOracs/Backup/My Project/Settings.Designer.vb delete mode 100644 Sub/WinsockOracs/Backup/My Project/Settings.settings delete mode 100644 Sub/WinsockOracs/Backup/ObjectPacker.vb delete mode 100644 Sub/WinsockOracs/Backup/Resources/k-koding.png delete mode 100644 Sub/WinsockOracs/Backup/SharedMethods.vb delete mode 100644 Sub/WinsockOracs/Backup/Winsock Orcas.vbproj delete mode 100644 Sub/WinsockOracs/Backup/Winsock.png delete mode 100644 Sub/WinsockOracs/Backup/Winsock.vb delete mode 100644 Sub/WinsockOracs/Backup/WinsockCollection.vb delete mode 100644 Sub/WinsockOracs/Backup/WinsockDesigner.vb delete mode 100644 Sub/WinsockOracs/Backup/WinsockFileData.vb delete mode 100644 Sub/WinsockOracs/Backup/frmAbout.Designer.vb delete mode 100644 Sub/WinsockOracs/Backup/frmAbout.resx delete mode 100644 Sub/WinsockOracs/Backup/frmAbout.vb delete mode 100644 Sub/WinsockOracs/UpgradeLog.htm diff --git a/Sub/WinsockOracs/Backup/About.txt b/Sub/WinsockOracs/Backup/About.txt deleted file mode 100644 index b1678af..0000000 --- a/Sub/WinsockOracs/Backup/About.txt +++ /dev/null @@ -1,23 +0,0 @@ -Winsock Orcas is the result of refining a project that started when I graduated from VB6 to VB.NET 2003. - -.NET no longer supported the old Winsock control that had been so easy to use in VB6. Instead they gave us something with much more power, but also much more complexity: the Socket. - -It took me a bit of time to figure the socket out, but when I did I decided to create a wrapper that worked just like the old control I was familiar with - making sockets much easier. - -The first version was wrought with bugs and wasn't thread-safe. When VS 2005 came out, and revealed even more functions with regards to the socket - I resolved to make a new version. - -That was Winsock 2005. It was thread-safe (to a point), and fixed the major bugs of the previous version. It even had UDP support. - -In April of 2007 I started work on Winsock 2007. Due to a project I was working on at the time, I was looking into Remoting to synchronize an object between server/client. I decided Remoting wasn't for my project (couldn't implement blacklist), thus a new version of Winsock was born. - -Winsock 2007 enabled synchronizing of objects (via BinaryFormatter), making the Send/Get routines simpler. The thread-safe events have been improved, as has UDP support. IPv6 support was added making it much easier to use with Vista. - -Winsock Orcas (version 4.0.0) was made just to keep this going. It had come to my attention that VS2008 had problems compiling the code for previous version, so I made this version. This version streamlines the code, making it simpler to read (mainly by removing the WinsockMonitor class), and also adds in some Generics support on the Get/Peek methods to do automatic conversion to the type you want (watch out, you could cause exceptions for casting to the wrong type). - -All in all I've enjoyed creating this component, and hope others find it as helpful as I have. - -To report bugs please visit: http://www.k-koding.com/ and use the bug tracker. - -Thanks for using it, - -Chris Kolkman \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/AsyncSocket.vb b/Sub/WinsockOracs/Backup/AsyncSocket.vb deleted file mode 100644 index 4d2c512..0000000 --- a/Sub/WinsockOracs/Backup/AsyncSocket.vb +++ /dev/null @@ -1,1247 +0,0 @@ -Option Strict On - -Imports System.Net -Imports System.Net.Sockets -Imports System.Threading - -''' -''' A class that encapsulates all the raw functions of the System.Net.Sockets.Socket -''' -Public Class AsyncSocket - - Private myParent As IWinsock ' The parent Winsock - allows access to properties and event raising - Private mSock1 As Socket ' for IPv4 (listening) or both IPv4 and IPv6 (connections) - Private mSock2 As Socket ' for IPv6 (listening) only - Private byteBuffer() As Byte ' Stores the incoming bytes waiting to be processed - Private incBufferSize As Integer = 8192 ' The buffer size of the socket - Private _buff As ByteBufferCol ' Temporary byte buffer - used while an object is being assembled - Private _closing As Boolean = False ' Prevents the Close() method from being run while it already running - Private qBuffer As Queue ' The Buffer Queue - where objects wait to be picked up by the Get() method - Private phProcessor As PacketHeader ' The PacketHeader processor - looks for and reads the packet header added to the byte array - Private sBufferMutex As New Mutex() - Private sendBuffer As Deque ' The Sending Buffer Queue - where objects wait to be sent. - Private thdSendLoop As Thread ' Used to send everything in the sendBuffer - Private lckSendLoop As Object ' Used for a syncronized lock on the SendLoop thread - Private bIsSending As Boolean ' Used internally to tell if a sending loop is in progress. - - Public Sub New(ByRef parent As IWinsock) - Try - myParent = parent - phProcessor = New PacketHeader - qBuffer = New Queue - _buff = New ByteBufferCol - sendBuffer = New Deque - lckSendLoop = New Object() - ReDim byteBuffer(incBufferSize) - Catch ex As Exception - SharedMethods.RaiseError(myParent, "Unable to initialize the AsyncSocket.") - End Try - End Sub - - ''' - ''' Gets a value containing the remote IP address. - ''' - Protected Friend ReadOnly Property RemoteIP() As String - Get - Dim rEP As System.Net.IPEndPoint = CType(mSock1.RemoteEndPoint, System.Net.IPEndPoint) - Return rEP.Address.ToString() - End Get - End Property - - ''' - ''' Gets a value containing the remote port number. - ''' - Protected Friend ReadOnly Property RemotePort() As Integer - Get - Dim rEP As System.Net.IPEndPoint = CType(mSock1.RemoteEndPoint, System.Net.IPEndPoint) - Return rEP.Port - End Get - End Property - - ''' - ''' Gets a value containing the local port number. - ''' - Protected Friend ReadOnly Property LocalPort() As Integer - Get - Dim lEP As System.Net.IPEndPoint = CType(mSock1.LocalEndPoint, IPEndPoint) - Return lEP.Port - End Get - End Property - - Protected Friend ReadOnly Property BufferCount() As Integer - Get - Dim i As Integer = -1 - SyncLock qBuffer.SyncRoot - i = qBuffer.Count - End SyncLock - Return i - End Get - End Property - - Protected Friend Property BufferSize() As Integer - Get - Return incBufferSize - End Get - Set(ByVal value As Integer) - incBufferSize = value - End Set - End Property - - Protected Friend ReadOnly Property UnderlyingStream() As Net.Sockets.NetworkStream - Get - If mSock1 IsNot Nothing Then Return New Net.Sockets.NetworkStream(mSock1, IO.FileAccess.ReadWrite, False) - Return Nothing - End Get - End Property - -#Region " Public Methods " - - ''' - ''' Accepts an incoming connection and starts the data listener. - ''' - ''' The client to accept. - Public Function Accept(ByVal client As Socket) As Boolean - Try - If myParent.State <> WinsockStates.Closed Then - Throw New Exception("Cannot accept a connection while the State is not closed.") - End If - mSock1 = client - Receive() - myParent.ChangeState(WinsockStates.Connected) - Dim e As New WinsockConnectedEventArgs(CType(mSock1.RemoteEndPoint, System.Net.IPEndPoint).Address.ToString, CType(mSock1.RemoteEndPoint, System.Net.IPEndPoint).Port) - myParent.OnConnected(e) - Return True - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - Return False - End Try - End Function - - ''' - ''' Closes the socket if its already open or listening. - ''' - Public Sub Close() - Try - ' If we are already closing then exit the subroutine - If _closing Then Exit Sub - ' Set the closing flag so that this doesn't get run more than once - ' at a time. - _closing = True - ' If we are already closed - exit the subroutine - If myParent.State = WinsockStates.Closed Then _closing = False : Exit Sub - Dim bAllowDisconnect As Boolean = False - ' Close the Socket(s) as necessary - Select Case myParent.State - Case WinsockStates.Connected - ' Change the state to Closing - myParent.ChangeState(WinsockStates.Closing) - If mSock1 IsNot Nothing Then mSock1.Close() - ' Allow disconnect event to raise - bAllowDisconnect = True - Case WinsockStates.Listening - ' Change the state to Closing - myParent.ChangeState(WinsockStates.Closing) - If mSock1 IsNot Nothing Then mSock1.Close() - If mSock2 IsNot Nothing Then mSock2.Close() - ' Do not allow Disconnect event - we weren't connected to anything - ' only listening. - bAllowDisconnect = False - End Select - ' Change state to Closed - myParent.ChangeState(WinsockStates.Closed) - ' Raise the Disconnected event - if allowed to - If bAllowDisconnect Then myParent.OnDisconnected() - _closing = False - Catch ex As Exception - _closing = False - If ex.InnerException IsNot Nothing Then - SharedMethods.RaiseError(myParent, ex.Message, ex.InnerException.Message) - Else - SharedMethods.RaiseError(myParent, ex.Message) - End If - End Try - End Sub - - ''' - ''' Starts Listening for incoming connections. For UDP sockets it starts listening for incoming data. - ''' - ''' The port to start listening on. - ''' The maximum length of the pending connections queue. - Public Sub Listen(ByVal port As Integer, ByVal max_pending As Integer) - Try - If myParent.Protocol = WinsockProtocol.Tcp Then - Dim blnChangePort As Boolean = False - ' Start listening on IPv4 - if available - If Socket.SupportsIPv4 Then - mSock1 = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) - Dim ipLocal As New IPEndPoint(IPAddress.Any, port) - mSock1.Bind(ipLocal) - mSock1.Listen(max_pending) - mSock1.BeginAccept(New AsyncCallback(AddressOf ListenCallback), mSock1) - End If - ' if port was 0 find port used for IPv4 and use it for IPv6 - If port = 0 Then - Dim lEP As System.Net.IPEndPoint = CType(mSock1.LocalEndPoint, IPEndPoint) - port = lEP.Port - blnChangePort = True - End If - ' Start listening on IPv6 - if available - If Socket.OSSupportsIPv6 Then - mSock2 = New Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp) - Dim ipLocal As New IPEndPoint(IPAddress.IPv6Any, port) - mSock2.Bind(ipLocal) - mSock2.Listen(max_pending) - mSock2.BeginAccept(New AsyncCallback(AddressOf ListenCallback), mSock2) - End If - If blnChangePort Then - myParent.ChangeLocalPort(port) - End If - ' Change state to Listening - myParent.ChangeState(WinsockStates.Listening) - ElseIf myParent.Protocol = WinsockProtocol.Udp Then - If port <= 0 Then - Throw New ArgumentException("While port 0 works for getting random port for UPD, there is no way for the server operator to know the port used until a completed send/receive method call is used which means the port is known already.", "port") - End If - ' Start data listening on IPv4 - if available - If Socket.SupportsIPv4 Then - mSock1 = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) - - Dim ipLocal As New IPEndPoint(IPAddress.Any, port) - Dim ipeSender As New IPEndPoint(IPAddress.Any, 0) - - Dim xe As New UdpReceiveState() - xe.SendingSocket = mSock1 - xe.ReceivingEndpoint = ipeSender - - mSock1.Bind(ipLocal) - mSock1.BeginReceiveFrom(byteBuffer, 0, incBufferSize, SocketFlags.None, xe.ReceivingEndpoint, New AsyncCallback(AddressOf ReceiveCallbackUDP), xe) - End If - ' Start data listening on IPv6 - if available - If Socket.OSSupportsIPv6 Then - mSock2 = New Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp) - - Dim ipLocal As New IPEndPoint(IPAddress.IPv6Any, port) - Dim ipeSender As New IPEndPoint(IPAddress.IPv6Any, 0) - - Dim xe As New UdpReceiveState() - xe.SendingSocket = mSock2 - xe.ReceivingEndpoint = ipeSender - - mSock2.Bind(ipLocal) - mSock2.BeginReceiveFrom(byteBuffer, 0, incBufferSize, SocketFlags.None, xe.ReceivingEndpoint, New AsyncCallback(AddressOf ReceiveCallbackUDP), xe) - End If - myParent.ChangeState(WinsockStates.Listening) - End If - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' Starts Listening for incoming connections on the specified IP address. For UDP sockets it starts listening for incoming data. - ''' - ''' The port to start listening on. - ''' The maximum length of the pending connections queue. - ''' The IP address on which to listen. - Public Sub Listen(ByVal port As Integer, ByVal max_pending As Integer, ByVal ip As IPAddress) - Try - ' IP contains information on type (IPv4 vs. IPv6) so we can just work with that - If myParent.Protocol = WinsockProtocol.Tcp Then - mSock1 = New Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp) - Dim ipLocal As New IPEndPoint(ip, port) - mSock1.Bind(ipLocal) - mSock1.Listen(max_pending) - mSock1.BeginAccept(New AsyncCallback(AddressOf ListenCallback), mSock1) - If port = 0 Then - Dim lEP As System.Net.IPEndPoint = CType(mSock1.LocalEndPoint, IPEndPoint) - myParent.ChangeLocalPort(lEP.Port) - End If - ElseIf myParent.Protocol = WinsockProtocol.Udp Then - If port <= 0 Then - Throw New ArgumentException("While port 0 works for getting random port for UPD, there is no way for the server operator to know the port used until a completed send/receive method call is used which means the port is known already.", "port") - End If - mSock1 = New Socket(ip.AddressFamily, SocketType.Dgram, ProtocolType.Udp) - - Dim ipLocal As New IPEndPoint(ip, port) - Dim ipeSender As New IPEndPoint(ip, 0) - - Dim xe As New UdpReceiveState() - xe.SendingSocket = mSock1 - xe.ReceivingEndpoint = ipeSender - - mSock1.Bind(ipLocal) - mSock1.BeginReceiveFrom(byteBuffer, 0, incBufferSize, SocketFlags.None, xe.ReceivingEndpoint, New AsyncCallback(AddressOf ReceiveCallbackUDP), xe) - End If - myParent.ChangeState(WinsockStates.Listening) - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' Gets the first object in the buffer without removing it. - ''' - Public Function PeekData() As Byte() - Dim ret() As Byte - SyncLock qBuffer.SyncRoot - If qBuffer.Count = 0 Then - ret = Nothing - Else - ret = DirectCast(qBuffer.Peek(), Byte()) - End If - End SyncLock - Return ret - End Function - - ''' - ''' Gets and removes the first object in the buffer. - ''' - Public Function GetData() As Byte() - Dim ret() As Byte - SyncLock qBuffer.SyncRoot - If qBuffer.Count = 0 Then - ret = Nothing - Else - ret = DirectCast(qBuffer.Dequeue, Byte()) - End If - End SyncLock - Return ret - End Function - - ''' - ''' Attemps to connect to a remote computer. - ''' - ''' The remote host or IP address of the remote computer. - ''' The port number on which to connect to the remote computer. - Public Sub Connect(ByVal remoteHostOrIp As String, ByVal remote_port As Integer) - Try - If myParent.State <> WinsockStates.Closed Then - Throw New Exception("Cannot connect to a remote host when the Winsock State is not closed.") - End If - - myParent.ChangeState(WinsockStates.ResolvingHost) - - Dim resolvedIP As IPAddress = Nothing - If IPAddress.TryParse(remoteHostOrIp, resolvedIP) Then - myParent.ChangeState(WinsockStates.HostResolved) - Connect(resolvedIP, remote_port) - Else - Dns.BeginGetHostEntry(remoteHostOrIp, New AsyncCallback(AddressOf DoConnectCallback), remote_port) - End If - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - ''' - ''' Attempts to connect to a remote computer. - ''' - ''' The IP address of the remote computer. - ''' The port number on which to connect to the remote computer. - Public Sub Connect(ByVal remIP As IPAddress, ByVal port As Integer) - Try - Dim remEP As New IPEndPoint(remIP, port) - If myParent.State <> WinsockStates.HostResolved Then Exit Sub - mSock1 = New Socket(remIP.AddressFamily, SocketType.Stream, ProtocolType.Tcp) - myParent.ChangeState(WinsockStates.Connecting) - mSock1.BeginConnect(remEP, New AsyncCallback(AddressOf ConnectCallback), mSock1) - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message, ex.ToString) - End Try - End Sub - - ''' - ''' Sends data to the remote computer. - ''' - ''' The byte array of data to send. - Public Sub Send(ByVal byt() As Byte) - Try - ' If it's going out UDP, get the location it's going to - Dim remEP As IPEndPoint = Nothing - If myParent.Protocol = WinsockProtocol.Udp Then - Dim ihe As IPHostEntry = Dns.GetHostEntry(myParent.RemoteHost) - remEP = New IPEndPoint(ihe.AddressList(0), myParent.RemotePort) - End If - - ' LegacySupport doesn't need a header, so if it's NOT active we can add one - If Not myParent.LegacySupport Then - ' LegacySupport INACTIVE - add a packet header, the other end knows how to decode it - phProcessor.AddHeader(byt) - End If - - ' Create the data object and add it to the queue - Dim sqData As New SendQueueData(remEP, byt) - ' We must lock access to the send buffer to prevent simultaneous access - ' from multiple threads - SyncLock sendBuffer.SyncRoot - sendBuffer.Enqueue(sqData) - End SyncLock - - ' Start the sending process - if the process isn't already started. - SyncLock lckSendLoop - If Not bIsSending Then - thdSendLoop = New Thread(AddressOf DoSend) - thdSendLoop.Start() - End If - End SyncLock - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - -#End Region - -#Region " Callback Methods " - - ''' - ''' The callback for the listener - only used for a TCP listener. - ''' - ''' This routine starts again when finished making it loop to continuously receive connections. - Private Sub ListenCallback(ByVal ar As IAsyncResult) - Try - ' Get the socket doing the listening, if it's not there - ' we can't continue. - Dim listener As Socket = TryCast(ar.AsyncState, Socket) - If listener Is Nothing Then - Throw New Exception("Listener object no longer exists.") - End If - - ' End the Accept that was started - Dim client As Socket = listener.EndAccept(ar) - ' Raise ConnectionRequest event - Dim e As New WinsockConnectionRequestEventArgs(client) - myParent.OnConnectionRequest(e) - - ' If the Winsock is no longer in the listening state - ' close and exit gracefully. - If myParent.State <> WinsockStates.Listening Then - listener.Close() - Exit Sub - End If - ' start listening again - listener.BeginAccept(New AsyncCallback(AddressOf ListenCallback), listener) - Catch exO As ObjectDisposedException - ' Close was called, destroying the object - exit without - ' displaying an error. - Exit Try - Catch exS As SocketException - ' There was a problem with the connection - ' If the SocketError is not Success, then close and - ' show an error message - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - 'Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - Exit Try - End Select - Catch ex As Exception - ' General execption - show an error message. - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback method for the Receive method (UDP only) - used when there is incoming data. - ''' - Private Sub ReceiveCallbackUDP(ByVal ar As IAsyncResult) - Try - ' Get actively receiving socket and IPEndPoint - Dim xe As UdpReceiveState = CType(ar.AsyncState, UdpReceiveState) - Dim cb_UDP As Socket = CType(xe.SendingSocket, Socket) - ' Get the size of the received data - Dim iSize As Integer = cb_UDP.EndReceiveFrom(ar, xe.ReceivingEndpoint) - Dim remEP As IPEndPoint = TryCast(xe.ReceivingEndpoint, IPEndPoint) - If iSize < 1 Then - SyncLock _buff.SyncRoot - If _buff.Count > 0 Then _buff.Clear() - End SyncLock - Close() - Exit Sub - End If - ' Process the receieved data - ProcessIncoming(byteBuffer, iSize, remEP.Address.ToString, remEP.Port) - ' Clear and resize the buffer - ReDim byteBuffer(incBufferSize) - ' Restart data listener - Dim ipeSender As IPEndPoint - If remEP.AddressFamily = AddressFamily.InterNetwork Then - ipeSender = New IPEndPoint(IPAddress.Any, 0) - Else - ipeSender = New IPEndPoint(IPAddress.IPv6Any, 0) - End If - xe.ReceivingEndpoint = ipeSender - cb_UDP.BeginReceiveFrom(byteBuffer, 0, incBufferSize, SocketFlags.None, xe.ReceivingEndpoint, New AsyncCallback(AddressOf ReceiveCallbackUDP), xe) - Catch exO As ObjectDisposedException - ' Close was called, destroying the object - exit without - ' displaying an error. - Exit Try - Catch exS As SocketException - ' There was a problem with the connection - ' If the SocketError is not Success, then close and - ' show an error message - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - 'Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - Exit Try - End Select - Catch ex As Exception - ' General execption - show an error message. - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback for the Connect method - used on the client to start looking for data. - ''' - Private Sub ConnectCallback(ByVal ar As IAsyncResult) - Try - If myParent.State <> WinsockStates.Connecting Then Exit Sub - Dim sock As Socket = CType(ar.AsyncState, Socket) - sock.EndConnect(ar) - If myParent.State <> WinsockStates.Connecting Then sock.Close() : Exit Sub - ' start listening for data - Receive() - ' Finished - raise events... - myParent.ChangeState(WinsockStates.Connected) - ' Raise the Connected event - Dim ipE As IPEndPoint = DirectCast(sock.RemoteEndPoint, IPEndPoint) - Dim e As New WinsockConnectedEventArgs(ipE.Address.ToString, ipE.Port) - myParent.OnConnected(e) - Catch exS As SocketException - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - Exit Try - End Select - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback method for the Receive method (TCP only) - used when there is incoming data. - ''' - Private Sub ReceiveCallback(ByVal ar As IAsyncResult) - Try - ' Get the possible error code - Dim errCode As SocketError = CType(ar.AsyncState, SocketError) - ' Get the size of the incoming data while ending the receive - Dim iSize As Integer = mSock1.EndReceive(ar) - If iSize < 1 Then - ' no size identified - connection closed - SyncLock _buff.SyncRoot - If _buff.Count > 0 Then _buff.Clear() - End SyncLock - Close() - Exit Sub - End If - ' Get the remote IP address - Dim ipE As IPEndPoint = CType(mSock1.RemoteEndPoint, IPEndPoint) - ' Process the incoming data (also raises DataArrival) - ProcessIncoming(byteBuffer, iSize, ipE.Address.ToString, ipE.Port) - ReDim byteBuffer(incBufferSize) - ' Start listening for data again - mSock1.BeginReceive(byteBuffer, 0, incBufferSize, SocketFlags.None, errCode, New AsyncCallback(AddressOf ReceiveCallback), errCode) - Catch exS As SocketException - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - End Select - Catch exO As ObjectDisposedException - Exit Try - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback method for the Send method (TCP only) - loops if not all the data was sent. - ''' - Private Sub SendCallback(ByVal ar As IAsyncResult) - Try - ' Retrieve the AsyncState - Dim ssState As SendState = DirectCast(ar.AsyncState, SendState) - ' Update the total sent - while ending this send call - ssState.TotalSent += ssState.SendingSocket.EndSend(ar) - ' Build the event args for the event that will be raised - Dim e As New WinsockSendEventArgs(RemoteIP, ssState.TotalSent, ssState.Length) - If ssState.SendCompleted Then - ' Object finished sending - raise the SendComplete event - myParent.OnSendComplete(e) - ' Check for more items in the buffer - if so run the send again - ' we can't run DoSend from within the SyncLock, or we'll run into - ' a deadlock - Dim blnRunAgain As Boolean = False - SyncLock sendBuffer.SyncRoot - If sendBuffer.Count > 0 Then - blnRunAgain = True - End If - End SyncLock - If blnRunAgain Then DoSend() - Else - ' Raise SendProgress event - myParent.OnSendProgress(e) - ' Object still has more data in the buffer, get the next part and send it - Dim byt() As Byte - SyncLock sendBuffer.SyncRoot - Dim sqData As SendQueueData = sendBuffer.Dequeue(Of SendQueueData)() - byt = sqData.Data - If byt.GetUpperBound(0) > incBufferSize Then - Dim tmpByt() As Byte = SharedMethods.ShrinkArray(Of Byte)(byt, incBufferSize + 1) - sqData.Data = DirectCast(byt.Clone(), Byte()) - sendBuffer.Push(sqData) - byt = DirectCast(tmpByt.Clone(), Byte()) - End If - End SyncLock - ssState.SendingSocket.BeginSend(byt, 0, byt.Length, SocketFlags.None, ssState.ErrCode, New AsyncCallback(AddressOf SendCallback), ssState) - End If - Catch exS As SocketException - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - End Select - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback method for the Send method (UDP only) - loops if not all the data was sent. - ''' - Private Sub SendToCallback(ByVal ar As IAsyncResult) - Try - ' Retrieve the AsyncState - Dim ssState As SendState = DirectCast(ar.AsyncState, SendState) - ' Update the total sent - while ending this send call - ssState.TotalSent += ssState.SendingSocket.EndSendTo(ar) - ' Build the event args for the event that will be raised - Dim e As New WinsockSendEventArgs(ssState.SendToAddress.Address.ToString(), ssState.TotalSent, ssState.Length) - If ssState.SendCompleted Then - ' Object finished sending - raise the SendComplete event - myParent.OnSendComplete(e) - ' Check for more items in the buffer - if so run the send again - ' we can't run DoSend from within the SyncLock, or we'll run into - ' a deadlock - Dim blnRunAgain As Boolean = False - SyncLock sendBuffer.SyncRoot - If sendBuffer.Count > 0 Then - blnRunAgain = True - End If - End SyncLock - If blnRunAgain Then DoSend() - Else - ' Raise the SendProgress event - myParent.OnSendProgress(e) - ' Object still has more data in the buffer, get it and send it. - Dim byt() As Byte - SyncLock sendBuffer.SyncRoot - Dim sqData As SendQueueData = sendBuffer.Dequeue(Of SendQueueData)() - byt = sqData.Data - If byt.GetUpperBound(0) > incBufferSize Then - Dim tmpByt() As Byte = SharedMethods.ShrinkArray(Of Byte)(byt, incBufferSize + 1) - sqData.Data = DirectCast(byt.Clone(), Byte()) - sendBuffer.Push(sqData) - byt = DirectCast(tmpByt.Clone(), Byte()) - End If - End SyncLock - ssState.SendingSocket.BeginSendTo(byt, 0, byt.Length, SocketFlags.None, ssState.SendToAddress, New AsyncCallback(AddressOf SendToCallback), ssState) - End If - Catch exS As SocketException - Select Case exS.SocketErrorCode - Case Is <> SocketError.Success - Close() - SharedMethods.RaiseError(myParent, exS.Message, "", exS.SocketErrorCode) - End Select - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' The callback method for resolving the address given - starts the socket on connecting. - ''' - Public Sub DoConnectCallback(ByVal ar As IAsyncResult) - Try - Dim port As Integer = DirectCast(ar.AsyncState, Integer) - Dim resolved As IPHostEntry - Try - resolved = Dns.EndGetHostEntry(ar) - Catch ex As SocketException - resolved = Nothing - End Try - If resolved Is Nothing OrElse resolved.AddressList.Length = 0 Then - Dim name As String = CStr(IIf(resolved IsNot Nothing, """" & resolved.HostName & """ ", "")) - Throw New Exception("Hostname " & name & "could not be resolved.") - End If - myParent.ChangeState(WinsockStates.HostResolved) - Connect(resolved.AddressList(0), port) - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - -#End Region - -#Region " Private Methods " - - ''' - ''' Processes raw data that was received from the socket and places it into the appropriate buffer. - ''' - ''' The raw byte buffer containing the data received from the socket. - ''' The size of the data received from the socket (reported from the EndReceive). - ''' The IP address the data came from, used for event raising. - ''' The Port the data arrived on, used for event raising. - Private Sub ProcessIncoming(ByVal byt() As Byte, ByVal iSize As Integer, ByVal source_ip As String, ByVal source_port As Integer) - 'check if we are using LegacySupport - If myParent.LegacySupport Then - ' legacy support is active just output the data to the buffer - ' if we actually received some data - If iSize > 0 Then - ' yes we received some data - resize the array - ResizeArray(byt, iSize) - ' add the byte array to the buffer queue - SyncLock qBuffer.SyncRoot - qBuffer.Enqueue(byt) - End SyncLock - ' raise the DataArrival event - Dim e As New WinsockDataArrivalEventArgs(iSize, source_ip, source_port) - myParent.OnDataArrival(e) - End If - Else - SyncLock _buff.SyncRoot - ' legacy support is inactive - ' if total size is <= 0 no data came in - exit - If iSize <= 0 Then Exit Sub - ' reduce the size of the array to the reported size (fixes trailling zeros) - ResizeArray(byt, iSize) - ' Do we have a packet header? - If Not phProcessor.Completed And _buff.Count > 1 Then - ' no packet header and already have more than enough data for a header - ' most likely no header is coming - throw an error to use LegacySupport - phProcessor.Reset() - Throw New Exception("Unable to determine size of incoming packet. It's possible you may need to use Legacy Support.") - ElseIf Not phProcessor.Completed Then - phProcessor.ProcessHeader(byt, _buff) - If Not phProcessor.Completed Then - ProcessIncoming(byt, byt.Length, source_ip, source_port) - End If - End If - - ' Packet Header obtained... Process data, raise data arrival when all is received - If _buff.Count = 0 AndAlso byt.Length >= phProcessor.Size Then - ' everything is located in the byte array - If byt.GetUpperBound(0) > phProcessor.Size Then - ' everything and MORE in byte array - ' remove our data, and run process again on the rest - Dim tmp() As Byte = SharedMethods.ShrinkArray(Of Byte)(byt, phProcessor.Size) - ' add the data to the queue - SyncLock qBuffer.SyncRoot - qBuffer.Enqueue(tmp) - End SyncLock - ' reset the packet header processor - phProcessor.Reset() - ' raise the received progress event - Dim eR As New WinsockReceiveProgressEventArgs(source_ip, tmp.Length, phProcessor.Size) - myParent.OnReceiveProgress(eR) - ' raise the DataArrival event - Dim e As New WinsockDataArrivalEventArgs(tmp.Length, source_ip, source_port) - myParent.OnDataArrival(e) - ' process the extra data - ProcessIncoming(byt, byt.Length, source_ip, source_port) - Else - ' add everything to the queue - SyncLock qBuffer.SyncRoot - qBuffer.Enqueue(byt) - End SyncLock - ' raise the received progress event - Dim eR As New WinsockReceiveProgressEventArgs(source_ip, byt.Length, phProcessor.Size) - myParent.OnReceiveProgress(eR) - ' reset the packet header processor - phProcessor.Reset() - ' raise the DataArrival event - Dim e As New WinsockDataArrivalEventArgs(byt.Length, source_ip, source_port) - myParent.OnDataArrival(e) - End If - ElseIf _buff.Count > 0 AndAlso _buff.Combine().Length + byt.Length >= phProcessor.Size Then - ' if you include the temp buffer, we have all the data - ' get everything - _buff.Add(byt) - Dim tmp() As Byte = _buff.Combine() - ' clear the temp buffer - _buff.Clear() - If tmp.GetUpperBound(0) > phProcessor.Size Then - ' tmp contains more than what we need - ' remove what wee need, and then run the process again on the rest - Dim t2() As Byte = SharedMethods.ShrinkArray(Of Byte)(tmp, phProcessor.Size) - ' add the data to the queue - SyncLock qBuffer.SyncRoot - qBuffer.Enqueue(t2) - End SyncLock - ' raise the received progress event - Dim eR As New WinsockReceiveProgressEventArgs(source_ip, tmp.Length, phProcessor.Size) - myParent.OnReceiveProgress(eR) - ' reset the packet header processor - phProcessor.Reset() - ' raise the DataArrival event - Dim e As New WinsockDataArrivalEventArgs(tmp.Length, source_ip, source_port) - myParent.OnDataArrival(e) - ' process the extra data - ProcessIncoming(tmp, tmp.Length, source_ip, source_port) - Else - ' tmp contains only what we need - add it to the queue - SyncLock qBuffer.SyncRoot - qBuffer.Enqueue(tmp) - End SyncLock - ' raise the received progress event - Dim eR As New WinsockReceiveProgressEventArgs(source_ip, tmp.Length, phProcessor.Size) - myParent.OnReceiveProgress(eR) - ' reset the packet header processor - phProcessor.Reset() - ' raise the DataArrival event - Dim e As New WinsockDataArrivalEventArgs(tmp.Length, source_ip, source_port) - myParent.OnDataArrival(e) - End If - Else - _buff.Add(byt) - ' raise the received progress event - Dim eR As New WinsockReceiveProgressEventArgs(source_ip, _buff.Combine.Length, phProcessor.Size) - myParent.OnReceiveProgress(eR) - End If - End SyncLock - End If - End Sub - - ''' - ''' Resizes an array to the desired length - preserving the data at the begining of the array. - ''' - ''' The array to be resized. - ''' The size to resize the array to. - Private Sub ResizeArray(ByRef byt() As Byte, ByVal iSize As Integer) - If iSize - 1 < byt.GetUpperBound(0) Then - ReDim Preserve byt(iSize - 1) - End If - End Sub - - ''' - ''' Starts listening for incoming packets on the socket. - ''' - ''' The is private because, the user should never have to call this. - Private Sub Receive() - Try - Dim errorState As SocketError - mSock1.BeginReceive(byteBuffer, 0, incBufferSize, SocketFlags.None, errorState, New AsyncCallback(AddressOf ReceiveCallback), errorState) - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - - ''' - ''' Starts the sending of an object in the send buffer. - ''' - Private Sub DoSend() - Try - ' Retrieve the bytes to send - Dim byt() As Byte - Dim fullSize As Integer - Dim remEP As IPEndPoint - SyncLock sendBuffer.SyncRoot - If sendBuffer.Count = 0 Then Exit Sub - Dim sqData As SendQueueData = sendBuffer.Dequeue(Of SendQueueData)() - If sqData Is Nothing Then - Throw New Exception("Buffer count was greater than zero, yet a nothing was retrieved. Something broke.") - End If - remEP = sqData.IPAddress - byt = sqData.Data() - fullSize = byt.GetUpperBound(0) - If byt.GetUpperBound(0) > incBufferSize Then - Dim tmpByt() As Byte = SharedMethods.ShrinkArray(Of Byte)(byt, incBufferSize + 1) - sqData.Data = DirectCast(byt.Clone(), Byte()) - sendBuffer.Push(sqData) - byt = DirectCast(tmpByt.Clone(), Byte()) - End If - End SyncLock - - ' Send according to the appropriate protocol - If myParent.Protocol = WinsockProtocol.Tcp Then - Dim ssState As SendState = SendState.Build(fullSize, mSock1, incBufferSize) - mSock1.BeginSend(byt, 0, byt.Length, SocketFlags.None, ssState.ErrCode, New AsyncCallback(AddressOf SendCallback), ssState) - ElseIf myParent.Protocol = WinsockProtocol.Udp Then - Dim tmpSock As New Socket(remEP.AddressFamily, SocketType.Dgram, ProtocolType.Udp) - - Dim ssState As SendState = SendState.Build(fullSize, tmpSock, incBufferSize) - ssState.SendToAddress = remEP - tmpSock.BeginSendTo(byt, 0, byt.Length, SocketFlags.None, remEP, New AsyncCallback(AddressOf SendToCallback), ssState) - End If - Catch ex As Exception - SharedMethods.RaiseError(myParent, ex.Message) - End Try - End Sub - -#End Region - -#Region " Private Classes " - - ''' - ''' A class that decodes and stores the packet header information. - ''' - Public Class PacketHeader - - Private _delimiter As Byte - Private _hasDelim As Boolean - Private _size As Integer - - Public Sub New() - _size = -1 - _delimiter = Byte.MinValue - _hasDelim = False - End Sub - - ''' - ''' A Boolean value to determine if the class has found a delimiter yet. - ''' - Public ReadOnly Property HasDelimiter() As Boolean - Get - Return _hasDelim - End Get - End Property - - ''' - ''' A Boolean value to determine if the class has found the size or not. - ''' - Public ReadOnly Property HasSize() As Boolean - Get - Return _size > -1 - End Get - End Property - - ''' - ''' A Boolean value to determine if the header processing has been completed or not. - ''' - ''' Based on HasDelimiter and HasSize - Public ReadOnly Property Completed() As Boolean - Get - Return HasDelimiter AndAlso HasSize - End Get - End Property - - ''' - ''' The determined Size that was contained within the header. - ''' - Public ReadOnly Property Size() As Integer - Get - Return _size - End Get - End Property - - ''' - ''' The delimiter found within the header (typically the first byte). - ''' - Public Property Delimiter() As Byte - Get - Return _delimiter - End Get - Set(ByVal value As Byte) - _delimiter = value - _hasDelim = True - End Set - End Property - - ''' - ''' Processes a received byte array for possible header information to decode the length of the data received. - ''' - ''' The byte array to process. - ''' A temporary byte buffer to stored data in. - ''' The parameters must be passed ByRef to allow the other routines to work with the exact same data (and modified data). - Public Sub ProcessHeader(ByRef byt() As Byte, ByRef _buff As ByteBufferCol) - ' Do we have an opening delimiter? - If Not HasDelimiter Then - ' We do now - Delimiter = SharedMethods.ShrinkArray(Of Byte)(byt, 1)(0) - If byt Is Nothing OrElse byt.Length = 0 Then Exit Sub - End If - ' check for the next instance of the delimiter - Dim idx As Integer = Array.IndexOf(byt, _delimiter) - If idx = -1 Then - ' delimiter not found - add bytes to temp buffer - _buff.Add(byt) - Exit Sub - End If - ' delimiter was found, grab the size (part may be in the temp buffer) so combine them - Dim temp() As Byte = SharedMethods.ShrinkArray(Of Byte)(byt, (idx + 1)) - ReDim Preserve temp(temp.GetUpperBound(0) - 1) - _buff.Add(temp) - temp = _buff.Combine() - ' Clear the temp buffer - _buff.Clear() - ' convert the bytes containing the size back to string - Dim strSize As String = System.Text.Encoding.ASCII.GetString(temp) - ' try converting the string back to an integer - If Not Integer.TryParse(strSize, _size) Then - ' data not an integer, maybe legacy support should be used - ' reset the delimiter and the size - Reset() - ' throw the exception - Throw New Exception("Unable to determine size of incoming packet. It's possible you may need to use Legacy Support.") - End If - ' is there data to follow? - If _size = 0 Then - ' no data followed the size - ' reset the size and the delimiter - Reset() - ' exit - Exit Sub - End If - End Sub - - ''' - ''' Resets the packet processor for another run. - ''' - Public Sub Reset() - _delimiter = Byte.MinValue - _hasDelim = False - _size = -1 - End Sub - - ''' - ''' Adds a packet header to the byte array given. - ''' - ''' The byte array to prepend with a packet header. - Public Sub AddHeader(ByRef byt() As Byte) - 'Dim arrSize As Integer = byt.GetUpperBound(0) 'Gets the size of the data to be sent - Dim arrSize As Integer = byt.Length ' Gets the size of the data to be sent - Dim strSize() As Byte = System.Text.Encoding.ASCII.GetBytes(arrSize.ToString) ' Converts the size to a string (to handle sizes larger than 255) and converts that to a byte array - Dim fByte As Byte = FreeByte(strSize) ' Determines a byte not used by the size (delimiter) - strSize = EncloseByte(fByte, strSize) ' Put the delimeter around the size header - byt = AppendByte(strSize, byt) ' Combine the header with the data - End Sub - - ''' - ''' Determines which byte value was not used in the byte array. - ''' - ''' The byte array to check. - Private Function FreeByte(ByVal byt() As Byte) As Byte - 'look for a free byte between 1 and 255 - Dim lowest As Byte = 0 - For i As Integer = 1 To 255 - If Array.IndexOf(byt, CByte(i)) = -1 Then - lowest = CByte(i) - Exit For - End If - Next - Return lowest - End Function - - ''' - ''' Encloses a byte array with another byte. - ''' - ''' A byte to enclose around a byte array. - ''' The byte array that needs a byte enclosed around it. - Private Function EncloseByte(ByVal byt As Byte, ByVal bytArr() As Byte) As Byte() - Dim orig As Integer = bytArr.GetUpperBound(0) - Dim newa As Integer = orig + 2 - Dim ar(newa) As Byte - ar(0) = byt - Array.Copy(bytArr, 0, ar, 1, bytArr.Length) - ar(newa) = byt - Return ar - End Function - - ''' - ''' Combines two byte arrays. - ''' - Private Function AppendByte(ByVal first() As Byte, ByVal sec() As Byte) As Byte() - Dim orig As Integer = first.GetUpperBound(0) + sec.Length - Dim ar(orig) As Byte - Array.Copy(first, 0, ar, 0, first.Length) - Array.Copy(sec, 0, ar, first.GetUpperBound(0) + 1, sec.Length) - Return ar - End Function - - End Class - - ''' - ''' A class that allows a state to be transfered from the calling method to the asyncrounous callback method. - ''' This class is used for receiving data via UDP. - ''' - Private Class UdpReceiveState - - ''' - ''' The incoming socket information - allows UDP to determine the sender. - ''' - Public SendingSocket As Object - ''' - ''' The EndPoint on which the data was received (server side). - ''' - Public ReceivingEndpoint As EndPoint - - End Class - - ''' - ''' A class that helps store data waiting to be sent in the SendQueue - ''' - ''' - ''' This class was borne out of necessity - not for TCP, but for UDP. - ''' I realized that if you are sending large data chunks out via UDP - ''' to different remote addresses, you could end up sending data to - ''' the wrong remote host. This class allows the component to recognize - ''' that it needs to send to a different remote host. - ''' - Private Class SendQueueData - - ''' - ''' Initializes a new instance of the SendQueueData class. - ''' - ''' An IPEndPoint containing the IP address that you will be sending to. - ''' The data that needs to be sent. - Public Sub New(ByVal ip As IPEndPoint, ByVal byt() As Byte) - _ip = ip - _data = byt - End Sub - - Private _data() As Byte - Private _ip As IPEndPoint - - ''' - ''' The IPEndPoint that contains the IP address information needed to send the data. - ''' - Public ReadOnly Property IPAddress() As IPEndPoint - Get - Return _ip - End Get - End Property - - ''' - ''' The data that needs to be sent. - ''' - Public Property Data() As Byte() - Get - Return _data - End Get - Set(ByVal value As Byte()) - _data = value - End Set - End Property - - End Class - - ''' - ''' A class that allows a state to be transfered from the calling method to the asyncrounous callback method. - ''' This class is used when sending data. - ''' - Private Class SendState - - ''' - ''' The total length of the original byte array to be sent. (Includes packet header) - ''' - Public Length As Integer - ''' - ''' The error code as reported by the socket - used during the callback method. - ''' - Public ErrCode As SocketError - ' '' - ' '' The bytes that are to be sent. - ' '' - 'Public Bytes() As Byte - ''' - ''' The index at which to start sending - usefull when sending packets larger than the buffer size. - ''' - Public StartIndex As Integer - ''' - ''' The number of bytes to send during this time - usefull when sending packets larger than the buffer size. - ''' - Public SendLength As Integer - ''' - ''' The total number of bytes actually transmitted. - ''' - Public TotalSent As Integer - ''' - ''' The socket that is doing the sending - used for UDP statistic information during the callback method. - ''' - Public SendingSocket As Socket - ''' - ''' The IP address of the computer you are sending to - used for UDP statistic information during the callback method. - ''' - Public SendToAddress As IPEndPoint - - ''' - ''' Builds and returns an instance of the SendState class. - ''' - ''' The UpperBound of the byte array that will be sent. - ''' The socket to assign to the SendState. - ''' The socket's buffer size. - Public Shared Function Build(ByVal bytUpperBound As Integer, ByRef sock As Socket, ByVal buffer_size As Integer) As SendState - Dim ret As New SendState - ret.Length = bytUpperBound + 1 - ret.StartIndex = 0 - If bytUpperBound > buffer_size Then - ret.SendLength = buffer_size + 1 - Else - ret.SendLength = bytUpperBound - End If - ret.SendingSocket = sock - Return ret - End Function - - ''' - ''' Returns a boolean indicating whether the object being sent has completed or not. - ''' - Public ReadOnly Property SendCompleted() As Boolean - Get - Return Not (TotalSent < Length) - End Get - End Property - End Class - -#End Region - -End Class - -''' -''' A special collection class to act as a byte buffer. -''' -Public Class ByteBufferCol - Inherits CollectionBase - - ''' - ''' Adds a byte to the byte buffer. - ''' - ''' The byte to add to the buffer. - Public Sub Add(ByVal byt As Byte) - List.Add(byt) - End Sub - - ''' - ''' Adds a byte array to the byte buffer. - ''' - ''' The byte array to add to the buffer. - ''' Adds all the bytes in the array individually - not the array itself. - Public Sub Add(ByVal byt() As Byte) - For i As Integer = 0 To UBound(byt) - List.Add(byt(i)) - Next - End Sub - - ''' - ''' Combines all the bytes in the buffer into one byte array. - ''' - Public Function Combine() As Byte() - If List.Count = 0 Then Return Nothing - Dim ar(List.Count - 1) As Byte - For i As Integer = 0 To List.Count - 1 - ar(i) = CByte(List.Item(i)) - Next - Return ar - End Function - - Public ReadOnly Property SyncRoot() As Object - Get - Dim iCL As ICollection = CType(Me, ICollection) - ' Return CType(llList, ICollection).SyncRoot - Return iCL.SyncRoot - End Get - End Property - -End Class \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/Deque.vb b/Sub/WinsockOracs/Backup/Deque.vb deleted file mode 100644 index 256dc3c..0000000 --- a/Sub/WinsockOracs/Backup/Deque.vb +++ /dev/null @@ -1,185 +0,0 @@ -Option Strict On -''' -''' Represents both a last-in, first-out (LIFO) and a first-in, first-out (FIFO) non-generic collection of objects. -''' -''' -''' While the System.Collections.Stack and the System.Collections.Queue -''' have seemingly different ways of operating, they can be combined easily -''' by just manipulating the way in which an item in inserted into the list. -''' -''' This allows the removal from the list to remain the same, whether you -''' are treating this class like a Stack or a Queue. The also allows the -''' Peek() method to work for both at the same time. -''' -''' Helping tidbit - Deque is pronounced like "deck." -''' -Public Class Deque - Implements ICollection, IEnumerable, ICloneable - -#Region " Private Members " - - ''' - ''' Stores the list of items within this instance. - ''' - Private llList As LinkedList(Of Object) - -#End Region - -#Region " Constructor " - - ''' - ''' Initializes a new instance of the Deque class that is empty and has the default initial capacity. - ''' - Public Sub New() - llList = New LinkedList(Of Object) - End Sub - - ''' - ''' Initializes a new instance of the Deque class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied. - ''' - ''' The collection whose elements are copied to the new Deque. - Public Sub New(ByVal col As ICollection) - llList = New LinkedList(Of Object)(CType(col, IEnumerable(Of Object))) - End Sub - -#End Region - -#Region " Interface Method Implementations " - - ''' - ''' Copies the entire Deque to a compatible one-dimensional array, starting at the specified index of the target array. - ''' - ''' The one-dimensional Array that is the destination of the elements copied from Deque. The Array must have zero-based indexing. - ''' The zero-based index in array at which copying begins. - Public Sub CopyTo(ByVal array As System.Array, ByVal index As Integer) Implements System.Collections.ICollection.CopyTo - If array.Rank > 1 Then Throw New ArgumentException("Array must have only a single dimension.", "array") - llList.CopyTo(CType(array, Object()), index) - End Sub - - ''' - ''' Gets the number of elements actually contained in the Deque. - ''' - ''' The number of elements actually contained in the Deque. - Public ReadOnly Property Count() As Integer Implements System.Collections.ICollection.Count - Get - Return llList.Count - End Get - End Property - - ''' - ''' Gets a value indicating whether access to the ICollection is synchronized (thread safe). - ''' - ''' true if access to the ICollection is synchronized (thread safe); otherwise, false. In the default implementation of List, this property always returns false. - Public ReadOnly Property IsSynchronized() As Boolean Implements System.Collections.ICollection.IsSynchronized - Get - Return CType(llList, ICollection).IsSynchronized - End Get - End Property - - ''' - ''' Gets an object that can be used to synchronize access to the ICollection. - ''' - ''' An object that can be used to synchronize access to the ICollection. In the default implementation of List, this property always returns the current instance. - Public ReadOnly Property SyncRoot() As Object Implements System.Collections.ICollection.SyncRoot - Get - Return CType(llList, ICollection).SyncRoot - End Get - End Property - - ''' - ''' Returns an enumerator that iterates through the Queue. - ''' - Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator - Return llList.GetEnumerator() - End Function - - ''' - ''' Creates a shallow copy of the Queue. - ''' - Public Function Clone() As Object Implements System.ICloneable.Clone - Return New Deque(llList) - End Function - -#End Region - -#Region " Methods common to both Queues and Stacks " - - ''' - ''' Removes all elements from the Deque. - ''' - Public Sub Clear() - llList.Clear() - End Sub - - ''' - ''' Determines whether an element is in the Deque. - ''' - ''' The object to locate in the Deque. The value can be a null reference (Nothing in Visual Basic) for reference types. - Public Function Contains(ByVal obj As Object) As Boolean - Return llList.Contains(obj) - End Function - - ''' - ''' Returns the object at the beginning (top) of the Deque without removing it. - ''' - ''' The object at the beginning (top) of the Deque. - Public Function Peek(Of dataType)() As dataType - If llList.Count = 0 Then Return Nothing - Return DirectCast(llList.First().Value, dataType) - End Function - - ''' - ''' Returns a String that represents the current Object. - ''' - ''' A String that represents the current Object. - Public Overrides Function ToString() As String - Return llList.ToString() - End Function - -#End Region - -#Region " Queue methods " - - ''' - ''' Removes and returns the object at the beginning of the Deque. - ''' - ''' The object that is removed from the beginning of the Deque. - ''' Synonymous with Pop(). - Public Function Dequeue(Of dataType)() As dataType - Dim oRet As dataType = Peek(Of dataType)() - llList.RemoveFirst() - Return oRet - End Function - - ''' - ''' Adds an object to the end of the Deque. - ''' - ''' The object to add to the Deque. The value can be a null reference (Nothing in Visual Basic). - Public Sub Enqueue(ByVal obj As Object) - llList.AddLast(obj) - End Sub - -#End Region - -#Region " Stack methods " - - ''' - ''' Removes and returns the object at the top of the Deque. - ''' - ''' The Object removed from the top of the Deque. - ''' Synonymous with Dequeue(). - Public Function Pop(Of dataType)() As dataType - Return Dequeue(Of dataType)() - End Function - - ''' - ''' Inserts an object at the top of the Deque. - ''' - ''' The Object to push onto the Deque. The value can be a null reference (Nothing in Visual Basic). - Public Sub Push(ByVal obj As Object) - llList.AddFirst(obj) - End Sub - -#End Region - -End Class \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/Enumerations.vb b/Sub/WinsockOracs/Backup/Enumerations.vb deleted file mode 100644 index d132c37..0000000 --- a/Sub/WinsockOracs/Backup/Enumerations.vb +++ /dev/null @@ -1,49 +0,0 @@ -Option Strict On - -''' -''' Enumeration containing the various supported network protocols. -''' -Public Enum WinsockProtocol - ''' - ''' Transmission Control Protocol - a connection oriented protocol. - ''' - Tcp = 0 - ''' - ''' User Datagram Protocol - a connection-less protocol. - ''' - Udp = 1 -End Enum - -''' -''' Enumeration containing the various Winsock states. -''' -Public Enum WinsockStates - ''' - ''' The Winsock is closed. - ''' - Closed = 0 - ''' - ''' The Winsock is listening (TCP for connections, UDP for data). - ''' - Listening = 1 - ''' - ''' The Winsock is attempting the resolve the remote host. - ''' - ResolvingHost = 2 - ''' - ''' The remote host has been resolved to IP address. - ''' - HostResolved = 3 - ''' - ''' The Winsock is attempting to connect to the remote host. - ''' - Connecting = 4 - ''' - ''' The Winsock is connected to a remote source (client or server). - ''' - Connected = 5 - ''' - ''' The Winsock is attempting to close the connection. - ''' - Closing = 6 -End Enum \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/EventArgs.vb b/Sub/WinsockOracs/Backup/EventArgs.vb deleted file mode 100644 index 0bed9ec..0000000 --- a/Sub/WinsockOracs/Backup/EventArgs.vb +++ /dev/null @@ -1,422 +0,0 @@ -Option Strict On - -''' -''' Provides data for the Winsock.ErrorReceived event. -''' -Public Class WinsockErrorReceivedEventArgs - Inherits System.EventArgs - - Private m_errorMsg As String - Private m_function As String - Private m_errorCode As System.Net.Sockets.SocketError - Private m_Details As String - - ''' - ''' Initializes a new instance of the WinsockErrorEventArgs class. - ''' - ''' A String containing the error message. - Public Sub New(ByVal error_message As String) - Me.New(error_message, Nothing) - End Sub - ''' - ''' Initializes a new instance of the WinsockErrorEventArgs class. - ''' - ''' A String containing the error message. - ''' A String containing the name of the function that produced the error. - Public Sub New(ByVal error_message As String, ByVal function_name As String) - Me.New(error_message, function_name, Nothing) - End Sub - ''' - ''' Initializes a new instance of the WinsockErrorEventArgs class. - ''' - ''' A String containing the error message. - ''' A String containing the name of the function that produced the error. - ''' A String containing extra details for the error message. - Public Sub New(ByVal error_message As String, ByVal function_name As String, ByVal extra_details As String) - Me.New(error_message, function_name, extra_details, Net.Sockets.SocketError.Success) - End Sub - ''' - ''' Initializes a new instance of the WinsockErrorEventArgs class. - ''' - ''' A String containing the error message. - ''' A String containing the name of the function that produced the error. - ''' A String containing extra details for the error message. - ''' A value containing the socket's ErrorCode. - Public Sub New(ByVal error_message As String, ByVal function_name As String, ByVal extra_details As String, ByVal error_code As System.Net.Sockets.SocketError) - m_errorMsg = error_message - m_function = function_name - m_Details = extra_details - m_errorCode = error_code - End Sub - - ''' - ''' Gets a value containing the error message. - ''' - Public ReadOnly Property Message() As String - Get - Return m_errorMsg - End Get - End Property - - ''' - ''' Gets a value containing the name of the function that produced the error. - ''' - Public ReadOnly Property [Function]() As String - Get - Return m_function - End Get - End Property - - ''' - ''' Gets a value indicating the error code returned by the socket. - ''' - ''' If it wasn't returned by the socket, it defaults to success. - Public ReadOnly Property ErrorCode() As System.Net.Sockets.SocketError - Get - Return m_errorCode - End Get - End Property - - ''' - ''' Gets a value containing more details than the typical error message. - ''' - Public ReadOnly Property Details() As String - Get - Return m_Details - End Get - End Property -End Class - -''' -''' Provides data for the Winsock.ConnectionRequest event. -''' -Public Class WinsockConnectionRequestEventArgs - Inherits System.EventArgs - - Private _client As System.Net.Sockets.Socket - Private _cancel As Boolean = False - - ''' - ''' Initializes a new instance of the WinsockClientReceivedEventArgs class. - ''' - ''' A Socket object containing the new client that needs to be accepted. - Public Sub New(ByVal new_client As System.Net.Sockets.Socket) - _client = new_client - End Sub - - ''' - ''' Gets a value containing the client information. - ''' - ''' Used in accepting the client. - Public ReadOnly Property Client() As System.Net.Sockets.Socket - Get - Return _client - End Get - End Property - - ''' - ''' Gets a value containing the incoming clients IP address. - ''' - Public ReadOnly Property ClientIP() As String - Get - Dim rEP As System.Net.IPEndPoint = CType(_client.RemoteEndPoint, System.Net.IPEndPoint) - Return rEP.Address.ToString() - End Get - End Property - - ''' - ''' Gets or sets a value indicating whether the incoming client request should be cancelled. - ''' - Public Property Cancel() As Boolean - Get - Return _cancel - End Get - Set(ByVal value As Boolean) - _cancel = value - End Set - End Property -End Class - -''' -''' Provides data for the Winsock.StateChanged event. -''' -Public Class WinsockStateChangedEventArgs - Inherits System.EventArgs - - Private m_OldState As WinsockStates - Private m_NewState As WinsockStates - - ''' - ''' Initializes a new instance of the WinsockStateChangingEventArgs class. - ''' - ''' The old state of the Winsock control. - ''' The state the Winsock control is changing to. - Public Sub New(ByVal oldState As WinsockStates, ByVal newState As WinsockStates) - m_OldState = oldState - m_NewState = newState - End Sub - - ''' - ''' Gets a value indicating the previous state of the Winsock control. - ''' - Public ReadOnly Property Old_State() As WinsockStates - Get - Return m_OldState - End Get - End Property - - ''' - ''' Gets a value indicating the new state of the Winsock control. - ''' - Public ReadOnly Property New_State() As WinsockStates - Get - Return m_NewState - End Get - End Property -End Class - -''' -''' Provides data for the Winsock.DataArrival event. -''' -Public Class WinsockDataArrivalEventArgs - Inherits System.EventArgs - - Private _bTotal As Integer - Private _IP As String - Private _Port As Integer - - ''' - ''' Initializes a new instance of the WinsockDataArrivalEventArgs class. - ''' - ''' The number of bytes that were received. - ''' The source address of the bytes. - ''' The source port of the bytes. - Public Sub New(ByVal bytes_total As Integer, ByVal source_ip As String, ByVal source_port As Integer) - _bTotal = bytes_total - _IP = source_ip - _Port = source_port - End Sub - - ''' - ''' Gets a value indicating the number of bytes received. - ''' - Public ReadOnly Property TotalBytes() As Integer - Get - Return _bTotal - End Get - End Property - - ''' - ''' Gets a value indicating the data's originating address. - ''' - Public ReadOnly Property SourceIP() As String - Get - Return _IP - End Get - End Property - - ''' - ''' Gets a value indicating the data's originating port. - ''' - Public ReadOnly Property SourcePort() As Integer - Get - Return _Port - End Get - End Property -End Class - -''' -''' Provides data for the Winsock.Connected event. -''' -Public Class WinsockConnectedEventArgs - Inherits System.EventArgs - - Private _IP As String - Private _Port As Integer - - ''' - ''' Initializes a new instance of the WinsockConnectedEventArgs class. - ''' - ''' The source address of the connection. - ''' The source port of the connection. - Public Sub New(ByVal source_ip As String, ByVal source_port As Integer) - _IP = source_ip - _Port = source_port - End Sub - - ''' - ''' Gets a value indicating the remote address of the connection. - ''' - Public ReadOnly Property SourceIP() As String - Get - Return _IP - End Get - End Property - - ''' - ''' Gets a value indicating the remote port of the connection. - ''' - Public ReadOnly Property SourcePort() As Integer - Get - Return _Port - End Get - End Property -End Class - -''' -''' Provides data for the Winsock.SendComplete event. -''' -Public Class WinsockSendEventArgs - Inherits System.EventArgs - - Private _bTotal As Integer - Private _bSent As Integer - Private _IP As String - - ''' - ''' Initializes a new instance of the WinsockSendEventArgs class. - ''' - ''' The destination of the bytes sent. - ''' The total number of bytes sent. - ''' The total number of bytes that were supposed to be sent. - Public Sub New(ByVal dest_ip As String, ByVal bytes_sent As Integer, ByVal bytes_total As Integer) - _IP = dest_ip - _bTotal = bytes_total - _bSent = bytes_sent - End Sub - - ''' - ''' Gets a value indicating the destination of the bytes sent. - ''' - Public ReadOnly Property DestinationIP() As String - Get - Return _IP - End Get - End Property - - ''' - ''' Gets a value indicating the number of bytes sent. - ''' - Public ReadOnly Property BytesSent() As Integer - Get - Return _bSent - End Get - End Property - - ''' - ''' Gets a value indicating the total number of bytes that should have been sent. - ''' - Public ReadOnly Property BytesTotal() As Integer - Get - Return _bTotal - End Get - End Property - - ''' - ''' Gets a value indicating the percentage (0-100) of bytes that where sent. - ''' - Public ReadOnly Property SentPercent() As Double - Get - Return (_bSent / _bTotal) * 100 - End Get - End Property - -End Class - -''' -''' Provides data for the WinsockCollection.CountChanged event. -''' -Public Class WinsockCollectionCountChangedEventArgs - Inherits System.EventArgs - - Private _oldCount As Integer - Private _newCount As Integer - - ''' - ''' Initializes a new instance of the WinsockCollectionCountChangedEventArgs class. - ''' - ''' The old number of items in the collection. - ''' The new number of items in the collection. - Public Sub New(ByVal old_count As Integer, ByVal new_count As Integer) - _oldCount = old_count - _newCount = new_count - End Sub - - ''' - ''' Gets a value indicating the previous number of items in the collection. - ''' - Public ReadOnly Property OldCount() As Integer - Get - Return _oldCount - End Get - End Property - - ''' - ''' Gets a value indicating the current number of items in the collection. - ''' - Public ReadOnly Property NewCount() As Integer - Get - Return _newCount - End Get - End Property -End Class - -''' -''' Provides data for the Winsock.ReceiveProgress event. -''' -Public Class WinsockReceiveProgressEventArgs - Inherits System.EventArgs - - Private _bTotal As Integer - Private _bIn As Integer - Private _IP As String - - ''' - ''' Initializes a new instance of the WinsockReceiveProgressEventArgs class. - ''' - ''' The source ip of the bytes received. - ''' The total number of bytes received. - ''' The total number of bytes that were supposed to be received. - Public Sub New(ByVal source_ip As String, ByVal bytes_received As Integer, ByVal bytes_total As Integer) - _IP = source_ip - _bTotal = bytes_total - _bIn = bytes_received - End Sub - - ''' - ''' Gets a value indicating the source of the bytes sent. - ''' - Public ReadOnly Property SourceIP() As String - Get - Return _IP - End Get - End Property - - ''' - ''' Gets a value indicating the number of bytes received. - ''' - Public ReadOnly Property BytesReceived() As Integer - Get - Return _bIn - End Get - End Property - - ''' - ''' Gets a value indicating the total number of bytes that should be received. - ''' - Public ReadOnly Property BytesTotal() As Integer - Get - Return _bTotal - End Get - End Property - - ''' - ''' Gets a value indicating the percentage (0-100) of bytes that where received. - ''' - Public ReadOnly Property ReceivedPercent() As Double - Get - Return (_bIn / _bTotal) * 100 - End Get - End Property - -End Class \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/History.txt b/Sub/WinsockOracs/Backup/History.txt deleted file mode 100644 index d9081e3..0000000 --- a/Sub/WinsockOracs/Backup/History.txt +++ /dev/null @@ -1,28 +0,0 @@ -04.21.2008 - Fixed RaiseEventSafe in Winsock.vb and WinsockCollection.vb to use BeginInvoke instead of Invoked. Changed order of operations in ReceiveCallbackUDP to allow remote IP address to be detected properly. - -03.25.2008 - Added a NetworkStream property to expose a NetworkStream object that uses the connection made by this component. - -03.24.2008 - Fixed Listen methods to properly raise state changed events for UDP as well as TCP. Modified IWinsock, Winsock, and AsyncSocket to allow AsyncSocket to modify the LocalPort property of the component. - -02.14.2008 - Fixed a bug in UDP receiving that caused it to always receive at the full byte buffer instead of size of the incoming data. - -12.28.2007 - Winsock.Get and Winsock.Peek updated to check for nothing. - SyncLock added to all qBuffer instances in AsyncSocket and _buff (ProcessIncoming) - -12.26.2007 - Added new event ReceiveProgress. - -12.13.2007 - Fixed PacketHeader.AddHeader to use .Length instead of .GetUpperBound(0). Also changed AsyncSocket.ProcessIncoming in two places with the same change (second half of the first nested IF statements with the >= comparison operator). - -11.19.2007 - Completed WinsockDesigner to original intentions. Can now jump to event code using the Action list. - -11.14.2007 - Demo programs completed, and test ran successfully (quick tests) - -11.06.2007 - Began work on version 4.0.0 - -Interim time - various bug fixes - -04.27.2007 - Third release using VS 2005 (called Winsock 2007) - -06.12.2006 - Second release using VS 2005 (called Winsock 2005) - -08.24.2005 - First release using VB 2003 (called Winsock.NET) \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/IWinsock.vb b/Sub/WinsockOracs/Backup/IWinsock.vb deleted file mode 100644 index e962a8c..0000000 --- a/Sub/WinsockOracs/Backup/IWinsock.vb +++ /dev/null @@ -1,111 +0,0 @@ -Option Strict On - -Public Interface IWinsock - -#Region " Events " - - ''' - ''' Occurs when connection is achieved (client and server). - ''' - Event Connected(ByVal sender As Object, ByVal e As WinsockConnectedEventArgs) - ''' - ''' Occurs on the server when a client is attempting to connect. - ''' - ''' Client registers connected at this point. Server must Accept in order for it to be connected. - Event ConnectionRequest(ByVal sender As Object, ByVal e As WinsockConnectionRequestEventArgs) - ''' - ''' Occurs when data arrives on the socket. - ''' - ''' Raised only after all parts of the data have been collected. - Event DataArrival(ByVal sender As Object, ByVal e As WinsockDataArrivalEventArgs) - ''' - ''' Occurs when disconnected from the remote computer (client and server). - ''' - Event Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) - ''' - ''' Occurs when an error is detected in the socket. - ''' - ''' May also be raised on disconnected (depending on disconnect circumstance). - Event ErrorReceived(ByVal sender As Object, ByVal e As WinsockErrorReceivedEventArgs) - ''' - ''' Occurs while the receive buffer is being filled with data. - ''' - Event ReceiveProgress(ByVal sender As Object, ByVal e As WinsockReceiveProgressEventArgs) - ''' - ''' Occurs when sending of data is completed. - ''' - Event SendComplete(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - ''' - ''' Occurs when the send buffer has been sent but not all the data has been sent yet. - ''' - Event SendProgress(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - ''' - ''' Occurs when the state of the socket changes. - ''' - Event StateChanged(ByVal sender As Object, ByVal e As WinsockStateChangedEventArgs) - - ''' - ''' Raises the Connected event. - ''' - Sub OnConnected(ByVal e As WinsockConnectedEventArgs) - ''' - ''' Raises the ConnectionRequest event. - ''' - Sub OnConnectionRequest(ByVal e As WinsockConnectionRequestEventArgs) - ''' - ''' Raises the DataArrival event. - ''' - Sub OnDataArrival(ByVal e As WinsockDataArrivalEventArgs) - ''' - ''' Raises the Disconnected event. - ''' - Sub OnDisconnected() - ''' - ''' Raises the ErrorReceived event. - ''' - Sub OnErrorReceived(ByVal e As WinsockErrorReceivedEventArgs) - ''' - ''' Raises the ReceiveProgress event. - ''' - Sub OnReceiveProgress(ByVal e As WinsockReceiveProgressEventArgs) - ''' - ''' Raises the SendComplete event. - ''' - Sub OnSendComplete(ByVal e As WinsockSendEventArgs) - ''' - ''' Raises the SendProgress event. - ''' - Sub OnSendProgress(ByVal e As WinsockSendEventArgs) - ' '' - ' '' Raises the StateChanged event. - ' '' - 'Sub OnStateChanged(ByVal e As WinsockStateChangedEventArgs) - -#End Region - -#Region " Properties " - - Property LegacySupport() As Boolean - Property Protocol() As WinsockProtocol - Property RemoteHost() As String - Property RemotePort() As Integer - ''' - ''' Gets the state of the Winsock control. - ''' - ReadOnly Property State() As WinsockStates - -#End Region - - ''' - ''' Encapsulates the OnStateChanged methods so the AsyncSocket - ''' doesn't have to build the EventArgs parameter all the time. - ''' - ''' The new state of the Winsock. - Sub ChangeState(ByVal new_state As WinsockStates) - - ''' - ''' When the port is set dynamically by using port 0, the socket can now update the property of the component. - ''' - ''' The port we are now listening on. - Sub ChangeLocalPort(ByVal new_port As Integer) -End Interface \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/My Project/Application.Designer.vb b/Sub/WinsockOracs/Backup/My Project/Application.Designer.vb deleted file mode 100644 index 651bd86..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Application.Designer.vb +++ /dev/null @@ -1,13 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1318 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - diff --git a/Sub/WinsockOracs/Backup/My Project/Application.myapp b/Sub/WinsockOracs/Backup/My Project/Application.myapp deleted file mode 100644 index 758895d..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Application.myapp +++ /dev/null @@ -1,10 +0,0 @@ - - - false - false - 0 - true - 0 - 1 - true - diff --git a/Sub/WinsockOracs/Backup/My Project/AssemblyInfo.vb b/Sub/WinsockOracs/Backup/My Project/AssemblyInfo.vb deleted file mode 100644 index 4e330ee..0000000 --- a/Sub/WinsockOracs/Backup/My Project/AssemblyInfo.vb +++ /dev/null @@ -1,35 +0,0 @@ -Imports System -Imports System.Reflection -Imports System.Runtime.InteropServices - -' General Information about an assembly is controlled through the following -' set of attributes. Change these attribute values to modify the information -' associated with an assembly. - -' Review the values of the assembly attributes - - - - - - - - - - -'The following GUID is for the ID of the typelib if this project is exposed to COM - - -' Version information for an assembly consists of the following four values: -' -' Major Version -' Minor Version -' Build Number -' Revision -' -' You can specify all the values or you can default the Build and Revision Numbers -' by using the '*' as shown below: -' - - - diff --git a/Sub/WinsockOracs/Backup/My Project/Resources.Designer.vb b/Sub/WinsockOracs/Backup/My Project/Resources.Designer.vb deleted file mode 100644 index 30a538d..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Resources.Designer.vb +++ /dev/null @@ -1,70 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1318 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - -Imports System - -Namespace My.Resources - - 'This class was auto-generated by the StronglyTypedResourceBuilder - 'class via a tool like ResGen or Visual Studio. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - ''' - ''' A strongly-typed resource class, for looking up localized strings, etc. - ''' - _ - Friend Module Resources - - Private resourceMan As Global.System.Resources.ResourceManager - - Private resourceCulture As Global.System.Globalization.CultureInfo - - ''' - ''' Returns the cached ResourceManager instance used by this class. - ''' - _ - Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager - Get - If Object.ReferenceEquals(resourceMan, Nothing) Then - Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Winsock_Orcas.Resources", GetType(Resources).Assembly) - resourceMan = temp - End If - Return resourceMan - End Get - End Property - - ''' - ''' Overrides the current thread's CurrentUICulture property for all - ''' resource lookups using this strongly typed resource class. - ''' - _ - Friend Property Culture() As Global.System.Globalization.CultureInfo - Get - Return resourceCulture - End Get - Set - resourceCulture = value - End Set - End Property - - Friend ReadOnly Property k_koding() As System.Drawing.Bitmap - Get - Dim obj As Object = ResourceManager.GetObject("k-koding", resourceCulture) - Return CType(obj,System.Drawing.Bitmap) - End Get - End Property - End Module -End Namespace diff --git a/Sub/WinsockOracs/Backup/My Project/Resources.resx b/Sub/WinsockOracs/Backup/My Project/Resources.resx deleted file mode 100644 index e11d804..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\k-koding.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/My Project/Settings.Designer.vb b/Sub/WinsockOracs/Backup/My Project/Settings.Designer.vb deleted file mode 100644 index 936bd24..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Settings.Designer.vb +++ /dev/null @@ -1,73 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' Runtime Version:2.0.50727.1318 -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict On -Option Explicit On - - -Namespace My - - _ - Partial Friend NotInheritable Class MySettings - Inherits Global.System.Configuration.ApplicationSettingsBase - - Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) - -#Region "My.Settings Auto-Save Functionality" -#If _MyType = "WindowsForms" Then - Private Shared addedHandler As Boolean - - Private Shared addedHandlerLockObject As New Object - - _ - Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) - If My.Application.SaveMySettingsOnExit Then - My.Settings.Save() - End If - End Sub -#End If -#End Region - - Public Shared ReadOnly Property [Default]() As MySettings - Get - -#If _MyType = "WindowsForms" Then - If Not addedHandler Then - SyncLock addedHandlerLockObject - If Not addedHandler Then - AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings - addedHandler = True - End If - End SyncLock - End If -#End If - Return defaultInstance - End Get - End Property - End Class -End Namespace - -Namespace My - - _ - Friend Module MySettingsProperty - - _ - Friend ReadOnly Property Settings() As Global.Winsock_Orcas.My.MySettings - Get - Return Global.Winsock_Orcas.My.MySettings.Default - End Get - End Property - End Module -End Namespace diff --git a/Sub/WinsockOracs/Backup/My Project/Settings.settings b/Sub/WinsockOracs/Backup/My Project/Settings.settings deleted file mode 100644 index 85b890b..0000000 --- a/Sub/WinsockOracs/Backup/My Project/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Sub/WinsockOracs/Backup/ObjectPacker.vb b/Sub/WinsockOracs/Backup/ObjectPacker.vb deleted file mode 100644 index 4fe5627..0000000 --- a/Sub/WinsockOracs/Backup/ObjectPacker.vb +++ /dev/null @@ -1,53 +0,0 @@ -Imports System.IO -Imports System.Xml -Imports System.Xml.Serialization -Imports System.Runtime.Serialization.Formatters.Binary - -''' -''' Contains function for serializing/deserializing an object to and from a byte array. -''' -Public Class ObjectPacker - - ''' - ''' Serializes an object to a byte array. - ''' - ''' The object to be serialized. - Public Shared Function GetBytes(ByVal obj As Object) As Byte() - If obj.GetType Is GetType(Byte).MakeArrayType Then - Return CType(obj, Byte()) - End If - Dim ret() As Byte = Nothing - Dim blnRetAfterClose As Boolean = False - Dim ms As New MemoryStream() - Dim bf As New BinaryFormatter() - Try - bf.Serialize(ms, obj) - Catch ex As Exception - blnRetAfterClose = True - Finally - ms.Close() - End Try - If blnRetAfterClose Then Return ret - ret = ms.ToArray() - Return ret - End Function - - ''' - ''' Deserializes an object from a byte array. - ''' - ''' The byte array from which to obtain the object. - Public Shared Function GetObject(ByVal byt() As Byte) As Object - Dim ms As New MemoryStream(byt, False) - Dim bf As New BinaryFormatter() - Dim x As Object - Try - x = bf.Deserialize(ms) - Catch ex As Exception - x = byt - Finally - ms.Close() - End Try - Return x - End Function - -End Class diff --git a/Sub/WinsockOracs/Backup/Resources/k-koding.png b/Sub/WinsockOracs/Backup/Resources/k-koding.png deleted file mode 100644 index 958f7fd116447357f59e346279d04c84b69a3c98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30384 zcmV(#K;*xPP)P0MF7Hix^YYod=iK{VR#pQtq(qTZ!0XJ) z%*uT4e)l`)JLcYG@Za(e=j?Nz2c>uq=vo6}tDSOkvu!2Ibx7{IT0E+%v82i(ySA^! zIleB=luK1$*J}Vw2R@Mi{*EEVA5MV(+O}_H5=v)0YMGvEHwF@^mglR@S5_OXYn@^1 z^G|{gjPalJCI2Wt>?eH!Kg`dkKmBRt`0+nvmFe|JyrpNVwqMw8DEV9rl4Vbie0P(n zjSjG;r$S5x$Y~y{*Z@2D`#pJp$r!+uCcuk308>eTkBoV++yeOarU^CMz{gbh=s}g| z4S;8NfHTkavs&Hm*k&soi$Yp>*1pBuS;qUnVe>S@bmAN-SnS2BcBLfQZb*YZfxybl3Q^qnGtqGa)ydbecUZluY+i9A&@J06!HErg1BV@*q#J?9UmVQpyTt% z;2gf@1Ty=(%gE-*B79rD8){&{7(R!81{V?JqiK8%zL5TY1s|-}fvt8_HX4VBZ6pgV z4GOyscVmj*n8=^r{NG+#UB7wFX-)pdr2QGj{Gap~_Wt}-nd{Gej;mLr>k*wrauu5o zuUTsUYD0;ae3jYAu%ie9;s>wc$eXGMhDTgf#s9+yU|!yZL;!jWUmU~N-K@#?f1;qm zmILDV-#rTOAFtpi_QI-k7zZs#XGru6eu0Wz6nWB7^qGYze8qvnrn z)|LL{nx@-mifI@L2>MAQcw`f2%>ZP4E`~s(RfhYE5|G8FWb!~v0=?sTKt9&CC5QmxN!+x|?_tIZ_UwYcBhJZl_p+EBtM*UuE6o%OW#88p`?5!lyD9xR~vdTGmpH}D`Z7n%yZi6$F~3kpuN zR4~ap9!Iir1lff)ekRT}e2h+kLt6I$H3MtfuJUG8i>=yPaV()0UoNd_qmTZ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Xnf!r`3Ljfg=O(7-Y=<7$zl+NvEHxHOmCGA+14f#QwekX)GH0$-c^fP> zPE3Y*MWiT!v{(PxvwySu{5J);ypA0^hHfzfc7o0JZC>9o3msfNq*#^VNRXG#mOFM8 z^{hds706^FF^kP2gd!mg85dn!Tc<4)NYTr$zFL4z+CY}dFGBPRd9par?Dr(wnSxfHH& zl#|P5F*ch=tZiv*wHo!i$wJmVHaXk#zy9Ta8f~`url0=ond#|;h1V&9SfEH&skC#& z=CTQr=`ltv&u}1Dq`K6Ebl<+6y2n3t=wYwJzUG%N9d*sv7B43AWDg)%VL%r92XXlv zzCHHu2F$zpUVxe_lyq+_X6Dqq^PADi`Y1$lWvyN&nu_Oc@sC3N`xibx<@nMh^i zI0l3~HcL#77ZjNa6X%dDddurTB%A@Xez?iDno!vQQ`CF&u8}U-%mny ze0#UlkLmjV4dg%c{;{oFw{luGZ4%0aDnZ{!uK)rerbtrgibQz%6v<0w(gakaL^c({ z_#Ea?9wRs$nv1b0z~$0BD4{HlD9aWIvr0ZUDHBWL<|=&>=Wvoa4ksl_B(f0D<)ZHY fT>rT~cI*EFpGBP8D3`p{00000NkvXXu0mjfQI)WT diff --git a/Sub/WinsockOracs/Backup/SharedMethods.vb b/Sub/WinsockOracs/Backup/SharedMethods.vb deleted file mode 100644 index 4ed0790..0000000 --- a/Sub/WinsockOracs/Backup/SharedMethods.vb +++ /dev/null @@ -1,85 +0,0 @@ -Option Strict On - -Imports System.Net.Sockets - -''' -''' This call contains shared methods that any class can use. -''' -Public Class SharedMethods - - ''' - ''' Raises an error on the parent Winsock object. - ''' - ''' The parent Winsock object to raise the error on. - ''' A String containing a message describing the error being raised. - Protected Friend Shared Sub RaiseError(ByRef iParent As IWinsock, ByVal msg As String) - ' First use the StackTrace to get the calling class and function. - Dim CurrentStack As New System.Diagnostics.StackTrace() - Dim callingFunction As String = CurrentStack.GetFrame(1).GetMethod.Name - Dim callingClass As String = CurrentStack.GetFrame(1).GetMethod.DeclaringType.ToString() - Dim caller As String = CStr(IIf(callingFunction.StartsWith("."), callingClass & callingFunction, callingClass & "." & callingFunction)) - ' Create the event arguement - Dim e As New WinsockErrorReceivedEventArgs(msg, caller) - ' Raise the event only if there really is a parent - If iParent IsNot Nothing Then - iParent.OnErrorReceived(e) - End If - End Sub - - ''' - ''' Raises an error on the parent Winsock object. - ''' - ''' The parent Winsock object to raise the error on. - ''' A String containing a message describing the error being raised. - ''' A String containing extra details describing the error being raised. - Protected Friend Shared Sub RaiseError(ByRef iParent As IWinsock, ByVal msg As String, ByVal details As String) - ' First use the StackTrace to get the calling class and function - Dim CurrentStack As New System.Diagnostics.StackTrace() - Dim callingFunction As String = CurrentStack.GetFrame(1).GetMethod.Name - Dim callingClass As String = CurrentStack.GetFrame(1).GetMethod.DeclaringType.ToString() - Dim caller As String = CStr(IIf(callingFunction.StartsWith("."), callingClass & callingFunction, callingClass & "." & callingFunction)) - ' Create the event arguement - Dim e As New WinsockErrorReceivedEventArgs(msg, caller, details) - ' Raise the event only if there really is a parent - If iParent IsNot Nothing Then - iParent.OnErrorReceived(e) - End If - End Sub - - ''' - ''' Raises an error on the parent Winsock object. - ''' - ''' The parent Winsock object to raise the error on. - ''' A String containing a message describing the error being raised. - ''' A String containing extra details describing the error being raised. - ''' A value containing the socket's error code. - Protected Friend Shared Sub RaiseError(ByRef iParent As IWinsock, ByVal msg As String, ByVal details As String, ByVal errCode As SocketError) - ' First use the StackTrace to get the calling class and function - Dim CurrentStack As New System.Diagnostics.StackTrace() - Dim callingFunction As String = CurrentStack.GetFrame(1).GetMethod.Name - Dim callingClass As String = CurrentStack.GetFrame(1).GetMethod.DeclaringType.ToString() - Dim caller As String = CStr(IIf(callingFunction.StartsWith("."), callingClass & callingFunction, callingClass & "." & callingFunction)) - ' Create the event arguement - Dim e As New WinsockErrorReceivedEventArgs(msg, caller, details, errCode) - ' Raise the event only if there really is a parent - If iParent IsNot Nothing Then - iParent.OnErrorReceived(e) - End If - End Sub - - ''' - ''' Removes items from the beginning of an array. - ''' - Protected Friend Shared Function ShrinkArray(Of arrayType)(ByRef arr() As arrayType, ByVal desiredLengthToTrim As Integer) As arrayType() - ' Grab desired length from array - this will be returned - Dim retArr(desiredLengthToTrim - 1) As arrayType - Array.Copy(arr, 0, retArr, 0, desiredLengthToTrim) - ' Trim what we grabbed out of the array - Dim tmpArr(arr.GetUpperBound(0) - desiredLengthToTrim) As arrayType - Array.Copy(arr, desiredLengthToTrim, tmpArr, 0, arr.Length - desiredLengthToTrim) - arr = DirectCast(tmpArr.Clone(), arrayType()) - ' Return the data - Return retArr - End Function - -End Class diff --git a/Sub/WinsockOracs/Backup/Winsock Orcas.vbproj b/Sub/WinsockOracs/Backup/Winsock Orcas.vbproj deleted file mode 100644 index b9f83ae..0000000 --- a/Sub/WinsockOracs/Backup/Winsock Orcas.vbproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {C422352B-E7E1-4CA6-9275-1142249D40E2} - Library - Winsock_Orcas - Winsock Orcas - 512 - Windows - v3.5 - On - Binary - Off - On - - - true - full - true - true - bin\Debug\ - Winsock Orcas.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Winsock Orcas.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - - Designer - frmAbout.vb - - - - - - frmAbout.vb - - - Form - - - - - - - Component - - - - - - - - - - - \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/Winsock.png b/Sub/WinsockOracs/Backup/Winsock.png deleted file mode 100644 index f54bf736cdc0d58a07c0a0171cc5a25b5e007e0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 749 zcmVIO@l#-%@K+Q7zAyIUxr7=;KLsPe99&9Qy zmp_aWYb=E&ic)qE1ceaTL3I)s3+v0Pdzpnl)xpCDFYk3f*Ymue2{3J{X-|sELAYmu z=`Mqi(_pe~fr(oVM(R_x-rovW3XC#01TV%_L0BAvr#_hKf!+|yzTW7{?3 zIuq0Vz);x1M>XE7-^4 zB)oZq-|zSSd<|RjL3Q0FaG93$Sb#=w6_iQ0NQ>FM@oa+ksPjrN7+e#)=Jk5tx!vxB zO+TG2$)d_PZTpo~g1ZG9e0&b?=MikQx3}AOy1Ns6Sn&5>og;!Hg4gVJ`{#y+hUEVS z2o4GUBDiwY}B+wa2=)lh*=g2T3C=Dq fF3wcNZJhl8^(M*LyGLEt00000NkvXXu0mjfpmtoM diff --git a/Sub/WinsockOracs/Backup/Winsock.vb b/Sub/WinsockOracs/Backup/Winsock.vb deleted file mode 100644 index 2cbb805..0000000 --- a/Sub/WinsockOracs/Backup/Winsock.vb +++ /dev/null @@ -1,583 +0,0 @@ -Option Strict On - -Imports System.ComponentModel -Imports System.ComponentModel.Design -Imports System.Drawing -Imports System.Net - - _ - _ - _ -Public Class Winsock - Inherits Component - Implements IWinsock - - Public Sub New() - _localPort = 8080 - _remotePort = 8080 - _remoteHost = "localhost" - _maxPendingConnections = 1 - _legacySupport = False - _protocol = WinsockProtocol.Tcp - _wsState = WinsockStates.Closed - _asSock = New AsyncSocket(Me) - End Sub - -#Region " Events " - - ''' - ''' Triggers an event declared at module level within a class, form, or document in a thread-safe manner. - ''' - ''' The event to be raised. - ''' The arguements for the event. - Private Sub RaiseEventSafe(ByVal ev As System.Delegate, ByRef args() As Object) - Dim bFired As Boolean - If ev IsNot Nothing Then - For Each singleCast As System.Delegate In ev.GetInvocationList() - bFired = False - Try - Dim syncInvoke As ISynchronizeInvoke = CType(singleCast.Target, ISynchronizeInvoke) - If syncInvoke IsNot Nothing AndAlso syncInvoke.InvokeRequired Then - bFired = True - syncInvoke.BeginInvoke(singleCast, args) - Else - bFired = True - singleCast.DynamicInvoke(args) - End If - Catch ex As Exception - If Not bFired Then singleCast.DynamicInvoke(args) - End Try - Next - End If - End Sub - - ''' - ''' Occurs when connection is achieved (client and server). - ''' - Public Event Connected(ByVal sender As Object, ByVal e As WinsockConnectedEventArgs) Implements IWinsock.Connected - ''' - ''' Occurs on the server when a client is attempting to connect. - ''' - ''' Client registers connected at this point. Server must Accept in order for it to be connected. - Public Event ConnectionRequest(ByVal sender As Object, ByVal e As WinsockConnectionRequestEventArgs) Implements IWinsock.ConnectionRequest - ''' - ''' Occurs when data arrives on the socket. - ''' - ''' Raised only after all parts of the data have been collected. - Public Event DataArrival(ByVal sender As Object, ByVal e As WinsockDataArrivalEventArgs) Implements IWinsock.DataArrival - ''' - ''' Occurs when disconnected from the remote computer (client and server). - ''' - Public Event Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) Implements IWinsock.Disconnected - ''' - ''' Occurs when an error is detected in the socket. - ''' - ''' May also be raised on disconnected (depending on disconnect circumstance). - Public Event ErrorReceived(ByVal sender As Object, ByVal e As WinsockErrorReceivedEventArgs) Implements IWinsock.ErrorReceived - ''' - ''' Occurs while the receive buffer is being filled with data. - ''' - Public Event ReceiveProgress(ByVal sender As Object, ByVal e As WinsockReceiveProgressEventArgs) Implements IWinsock.ReceiveProgress - ''' - ''' Occurs when sending of data is completed. - ''' - Public Event SendComplete(ByVal sender As Object, ByVal e As WinsockSendEventArgs) Implements IWinsock.SendComplete - ''' - ''' Occurs when the send buffer has been sent but not all the data has been sent yet. - ''' - Public Event SendProgress(ByVal sender As Object, ByVal e As WinsockSendEventArgs) Implements IWinsock.SendProgress - ''' - ''' Occurs when the state of the socket changes. - ''' - Public Event StateChanged(ByVal sender As Object, ByVal e As WinsockStateChangedEventArgs) Implements IWinsock.StateChanged - - ''' - ''' Raises the Connected event. - ''' - Public Sub OnConnected(ByVal e As WinsockConnectedEventArgs) Implements IWinsock.OnConnected - RaiseEventSafe(ConnectedEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the ConnectionRequest event. - ''' - Public Sub OnConnectionRequest(ByVal e As WinsockConnectionRequestEventArgs) Implements IWinsock.OnConnectionRequest - RaiseEventSafe(ConnectionRequestEvent, New Object() {Me, e}) - If e.Cancel Then - e.Client.Disconnect(False) - e.Client.Close() - End If - End Sub - - ''' - ''' Raises the DataArrival event. - ''' - Public Sub OnDataArrival(ByVal e As WinsockDataArrivalEventArgs) Implements IWinsock.OnDataArrival - RaiseEventSafe(DataArrivalEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the Disconnected event. - ''' - Public Sub OnDisconnected() Implements IWinsock.OnDisconnected - RaiseEventSafe(DisconnectedEvent, New Object() {Me, New System.EventArgs}) - End Sub - - ''' - ''' Raises the ErrorReceived event. - ''' - Public Sub OnErrorReceived(ByVal e As WinsockErrorReceivedEventArgs) Implements IWinsock.OnErrorReceived - RaiseEventSafe(ErrorReceivedEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the ReceiveProgress event. - ''' - Public Sub OnReceiveProgress(ByVal e As WinsockReceiveProgressEventArgs) Implements IWinsock.OnReceiveProgress - RaiseEventSafe(ReceiveProgressEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the SendComplete event. - ''' - Public Sub OnSendComplete(ByVal e As WinsockSendEventArgs) Implements IWinsock.OnSendComplete - RaiseEventSafe(SendCompleteEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the SendProgress event. - ''' - Public Sub OnSendProgress(ByVal e As WinsockSendEventArgs) Implements IWinsock.OnSendProgress - RaiseEventSafe(SendProgressEvent, New Object() {Me, e}) - End Sub - - ''' - ''' Raises the StateChanged event. - ''' - Private Sub OnStateChanged(ByVal e As WinsockStateChangedEventArgs) 'Implements IWinsock.OnStateChanged - If _wsState <> e.New_State Then - _wsState = e.New_State - RaiseEventSafe(StateChangedEvent, New Object() {Me, e}) - End If - End Sub - -#End Region - -#Region " Private Members " - - Private _asSock As AsyncSocket - Private _wsState As WinsockStates - Private _localPort As Integer - Private _maxPendingConnections As Integer - Private _remoteHost As String - Private _remotePort As Integer - Private _legacySupport As Boolean - Private _protocol As WinsockProtocol - -#End Region - -#Region " Helper Methods " - - ''' - ''' Encapsulates the OnStateChanged methods so the AsyncSocket - ''' doesn't have to build the EventArgs parameter all the time. - ''' - ''' The new state of the Winsock. - Protected Friend Sub ChangeState(ByVal new_state As WinsockStates) Implements IWinsock.ChangeState - OnStateChanged(New WinsockStateChangedEventArgs(_wsState, new_state)) - End Sub - - ''' - ''' When the port is set dynamically by using port 0, the socket can now update the property of the component. - ''' - ''' The port we are now listening on. - Protected Friend Sub ChangeLocalPort(ByVal new_port As Integer) Implements IWinsock.ChangeLocalPort - _localPort = new_port - End Sub - -#End Region - -#Region " Public Properties " - - ''' - ''' Gets or sets a value indicating the interal size of the byte buffers. - ''' - Public Property BufferSize() As Integer - Get - Return _asSock.BufferSize - End Get - Set(ByVal value As Integer) - _asSock.BufferSize = value - End Set - End Property - - ''' - ''' Gets a value indicating whether the buffer has data for retrieval. - ''' - _ - Public ReadOnly Property HasData() As Boolean - Get - Return _asSock.BufferCount > 0 - End Get - End Property - - ''' - ''' Gets or sets a value indicating if Legacy support should be used or not. - ''' - ''' Legacy support is to support older winsock style connections. - Public Property LegacySupport() As Boolean Implements IWinsock.LegacySupport - Get - Return _legacySupport - End Get - Set(ByVal value As Boolean) - If Not value AndAlso Protocol = WinsockProtocol.Udp Then - Throw New Exception("LegacySupport is required for UDP connections.") - End If - _legacySupport = value - End Set - End Property - - ''' - ''' Gets the local machine's IP address(es). - ''' - _ - Public ReadOnly Property LocalIP() As String() - Get - Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName) - Dim s(h.AddressList.Length - 1) As String - For i As Integer = 0 To h.AddressList.Length - 1 - s(i) = CType(h.AddressList.GetValue(i), Net.IPAddress).ToString - Next - Return s - End Get - End Property - - ''' - ''' Gets or sets a value indicating the port the control should listen on. - ''' - ''' Cannot change while listening, connected, or connecting - but can change while closing. - Public Property LocalPort() As Integer - Get - Return _localPort - End Get - Set(ByVal value As Integer) - Select Case State - Case WinsockStates.Listening - Throw New Exception("Cannot change the local port while already listening on a port.") - Case WinsockStates.Connected - Throw New Exception("Cannot change the local port of a connection that is already active.") - Case Else - If State <> WinsockStates.Closed AndAlso State <> WinsockStates.Closing Then - Throw New Exception("Cannot change the local port while the component is processing, it may have adverse effects on the connection process.") - End If - End Select - _localPort = value - End Set - End Property - - ''' - ''' Gets or sets a value that control the length of the maximum length of the pending connections queue. - ''' - ''' Cannot change while listening. - Public Property MaxPendingConnections() As Integer - Get - Return _maxPendingConnections - End Get - Set(ByVal value As Integer) - Select Case State - Case WinsockStates.Listening - Throw New Exception("Cannot change the pending connections value while already listening.") - End Select - _maxPendingConnections = value - End Set - End Property - - ''' - ''' Gets a NetworkStream that this Winsock object is based on. - ''' - _ - Public ReadOnly Property NetworkStream() As System.Net.Sockets.NetworkStream - Get - Return _asSock.UnderlyingStream - End Get - End Property - - ''' - ''' Gets or sets the winsock protocol to use when communicating with the remote computer. - ''' - _ - Public Property Protocol() As WinsockProtocol Implements IWinsock.Protocol - Get - Return _protocol - End Get - Set(ByVal value As WinsockProtocol) - If State <> WinsockStates.Closed Then - Throw New Exception("Cannot change the protocol while listening or connected to a remote computer.") - End If - _protocol = value - End Set - End Property - - ''' - ''' Gets or sets a value that determines what remote computer to connect to, or is currently connected to. - ''' - ''' Can only change if closed or listening. - Public Property RemoteHost() As String Implements IWinsock.RemoteHost - Get - Return _remoteHost - End Get - Set(ByVal value As String) - If State <> WinsockStates.Closed AndAlso State <> WinsockStates.Listening Then - Throw New Exception("Cannot change the remote host while already connected to a remote computer.") - End If - _remoteHost = value - End Set - End Property - - ''' - ''' Gets or sets a value that determines which port on the remote computer to connect on, or is currently connected on. - ''' - ''' Can only change if closed or listening. - Public Property RemotePort() As Integer Implements IWinsock.RemotePort - Get - Return _remotePort - End Get - Set(ByVal value As Integer) - If State <> WinsockStates.Closed AndAlso State <> WinsockStates.Listening Then - Throw New Exception("Cannot change the remote port while already connected to a remote computer.") - End If - _remotePort = value - End Set - End Property - - ''' - ''' Gets the state of the Winsock control. - ''' - _ - Public ReadOnly Property State() As WinsockStates Implements IWinsock.State - Get - Return _wsState - End Get - End Property - -#End Region - -#Region " Public Methods " - - ''' - ''' Places a Winsock in a listening state. - ''' - Public Sub Listen() - _asSock.Listen(LocalPort, MaxPendingConnections) - End Sub - ''' - ''' Places a Winsock in a listening state. - ''' - ''' The port Winsock should listen on. - Public Sub Listen(ByVal port As Integer) - If port < 0 Then - Throw New ArgumentException("Port cannot be less than zero.", "port") - End If - LocalPort = port - Listen() - End Sub - ''' - ''' Places a Winsock in a listening state. - ''' - ''' The IP address the Winsock should listen on. This must be an ip address. - Public Sub Listen(ByVal ip As String) - If ip Is Nothing Then - Listen() - Else - Dim ipAddr As IPAddress = Nothing - If Not IPAddress.TryParse(ip, ipAddr) Then - Throw New ArgumentException("IP address specified is not a valid IP address.", "ip") - End If - _asSock.Listen(LocalPort, MaxPendingConnections, ipAddr) - End If - End Sub - ''' - ''' Places a Winsock in a listening state. - ''' - ''' The IP address the Winsock should listen on. - ''' The port Winsock should listen on. - Public Sub Listen(ByVal ip As String, ByVal port As Integer) - If port < 0 Then - Throw New ArgumentException("Port cannot be less than zero.", "port") - End If - LocalPort = port - If ip Is Nothing Then - Listen() - Else - Dim ipAddr As IPAddress = Nothing - If Not IPAddress.TryParse(ip, ipAddr) Then - Throw New ArgumentException("IP address specified is not a valid IP address.", "ip") - End If - _asSock.Listen(LocalPort, MaxPendingConnections, ipAddr) - End If - End Sub - - ''' - ''' Accepts a client connect as valid and begins to monitor it for incoming data. - ''' - ''' A System.Net.Sockets.Socket that represents the client being accepted. - Public Sub Accept(ByVal client As Sockets.Socket) - If _asSock.Accept(client) Then - _localPort = _asSock.LocalPort - ' also set remote host and port - End If - End Sub - - ''' - ''' Creates an new Winsock and accepts the client connection on it. - ''' - ''' A System.Net.Sockets.Socket that represents the client being accepted. - ''' - ''' This was created to be used by the listener, to keep the listener listening while - ''' also accepting a connection. - ''' - Public Function AcceptNew(ByVal client As Sockets.Socket) As Winsock - Dim wskReturn As New Winsock() - wskReturn.Protocol = Me.Protocol - wskReturn.LegacySupport = Me.LegacySupport - wskReturn.Accept(client) - Return wskReturn - End Function - - ''' - ''' Closes an open Winsock connection. - ''' - Public Sub Close() - _asSock.Close() - End Sub - - ''' - ''' Establishes a connection to a remote host. - ''' - Public Sub Connect() - _asSock.Connect(RemoteHost, RemotePort) - End Sub - ''' - ''' Establishes a connection to a remote host. - ''' - ''' A System.String containing the Hostname or IP address of the remote host. - ''' A value indicating the port on the remote host to connect to. - Public Sub Connect(ByVal remoteHostOrIP As String, ByVal remote_port As Integer) - RemoteHost = remoteHostOrIP - RemotePort = remote_port - Connect() - End Sub - - ''' - ''' Sends an object to a connected socket on a remote computer. - ''' - ''' The object to send. - ''' - ''' The object is first serialized using a BinaryFormatter - unless - ''' it is already a byte array, in which case it just sends the byte array. - ''' - Public Sub Send(ByVal data As Object) - Dim byt() As Byte - If LegacySupport AndAlso data.GetType Is GetType(String) Then - byt = System.Text.Encoding.Default.GetBytes(CStr(data)) - Else - byt = ObjectPacker.GetBytes(data) - End If - _asSock.Send(byt) - End Sub - ''' - ''' Sends a file to a connected socket on a remote computer. - ''' - ''' The full path to the file you want to send. - ''' - ''' Creates a special file object to send, so the receiving end knows what to do with it. - ''' - Public Sub SendFile(ByVal filename As String) - Dim wsf As New WinsockFileData() - Try - If Not wsf.ReadFile(filename) Then - Throw New Exception("File does not exist, or there was a problem reading the file.") - End If - If LegacySupport Then - Send(wsf.FileData) - Else - Send(wsf) - End If - Catch ex As Exception - SharedMethods.RaiseError(Me, ex.Message) - End Try - End Sub - - ''' - ''' Gets the next object from the buffer, removing it from the buffer. - ''' - ''' - ''' A Deserialized object or if it can't be deserialized the byte array. - ''' - Public Function [Get]() As Object - Dim byt() As Byte = _asSock.GetData() - If byt Is Nothing Then Return Nothing - Return ObjectPacker.GetObject(byt) - End Function - ''' - ''' Gets the next object from the buffer as the supplied type, removing it from the buffer. - ''' - ''' The System.Type you wish to have the data returned as. - ''' - ''' A Deserialized object converted to the data type you wish. - ''' - ''' - ''' This function was added to make it easier for Option Strict users. - ''' It allows for easier conversion instead of the user using CType, DirectCast, or the like. - ''' Can throw an error if you specify the wrong type. - ''' - Public Function [Get](Of dataType)() As dataType - Dim byt() As Byte = _asSock.GetData() - If byt Is Nothing Then Return Nothing - Dim obj As Object - If LegacySupport AndAlso GetType(dataType) Is GetType(String) Then - obj = System.Text.Encoding.Default.GetString(byt) - Else - obj = ObjectPacker.GetObject(byt) - End If - Return DirectCast(obj, dataType) - End Function - - ''' - ''' Gets the next object from the buffer, leaving it ing the buffer. - ''' - ''' - ''' A Deserialized object or if it can't be deserialized the byte array. - ''' - Public Function Peek() As Object - Dim byt() As Byte = _asSock.PeekData() - If byt Is Nothing Then Return Nothing - Return ObjectPacker.GetObject(byt) - End Function - ''' - ''' Gets the next object from the buffer as the supplied type, leaving it in the buffer. - ''' - ''' The System.Type you wish to have the data returned as. - ''' - ''' A Deserialized object converted to the data type you wish. - ''' - ''' - ''' This function was added to make it easier for Option Strict users. - ''' It allows for easier conversion instead of the user using CType, DirectCast, or the like. - ''' Can throw an error if you specify the wrong type. - ''' - Public Function Peek(Of dataType)() As dataType - Dim byt() As Byte = _asSock.PeekData() - If byt Is Nothing Then Return Nothing - Dim obj As Object - If LegacySupport AndAlso GetType(dataType) Is GetType(String) Then - obj = System.Text.Encoding.Default.GetString(byt) - Else - obj = ObjectPacker.GetObject(byt) - End If - Return DirectCast(obj, dataType) - End Function - -#End Region - -End Class diff --git a/Sub/WinsockOracs/Backup/WinsockCollection.vb b/Sub/WinsockOracs/Backup/WinsockCollection.vb deleted file mode 100644 index e9ec07c..0000000 --- a/Sub/WinsockOracs/Backup/WinsockCollection.vb +++ /dev/null @@ -1,571 +0,0 @@ -Imports System.ComponentModel - -''' -''' A collection of Winsock objects. -''' -Public Class WinsockCollection - Inherits CollectionBase - - -#Region " Private Members " - - ' These two hashtables store the key's and the values. - ' The base class's List store the GUID that ties the - ' keys to the values - Private _keys As Hashtable - Private _values As Hashtable - - ' These are for auto removal of the Winsock object - ' when the Winsock's Disconnected event is raised. - Private _autoRemoval As Queue - Private _autoRemove As Boolean = False - - ' These are for timing and removal of every Winsock - ' object in the collection - only used when the - ' Clear() method is run. - Private _clearRemoval As Queue - Private _clearRemove As Boolean = False - Private _clearOK As Boolean = False - - ' Allows LegacySupport to work in a multi-client - ' environment - Private _legacySupport As Boolean = False - -#End Region - -#Region " Constructor " - - ''' - ''' Initializes a new instance of the WinsockCollection class. - ''' - ''' - ''' Determines if the collection should automatically remove the - ''' connection when the Disconnected event is fired. - ''' - ''' - ''' Enables LegacySupport for connections accepted using the - ''' collections Accept method. - ''' - Public Sub New(Optional ByVal auto_remove As Boolean = False, Optional ByVal legacy_support As Boolean = False) - _keys = New Hashtable - _values = New Hashtable - _autoRemoval = New Queue - _autoRemove = auto_remove - _clearRemoval = New Queue - _legacySupport = legacy_support - End Sub - -#End Region - -#Region " Overriden Methods " - - ''' - ''' Run when the base class's list is finished clearing. - ''' Triggers clearing of the keys and values - closing - ''' all connections. - ''' - Protected Overrides Sub OnClearComplete() - MyBase.OnClearComplete() - _keys.Clear() - Dim b As Boolean = _autoRemove : _autoRemove = False - _clearOK = False - _clearRemove = True - For Each wsk As Winsock In _values.Values - wsk.Close() - Next - _clearOK = True - _autoRemove = b - End Sub - - ''' - ''' Causes the CountChanged event to be triggered when an item is added to the collection. - ''' - Protected Overrides Sub OnInsertComplete(ByVal index As Integer, ByVal value As Object) - MyBase.OnInsertComplete(index, value) - OnCountChanged(List.Count - 1, List.Count) - End Sub - - ''' - ''' Causes the CountChanged event to be triggered when an item is removed from the collection. - ''' - Protected Overrides Sub OnRemoveComplete(ByVal index As Integer, ByVal value As Object) - MyBase.OnRemoveComplete(index, value) - OnCountChanged(List.Count + 1, List.Count) - End Sub - -#End Region - -#Region " Private Methods " - - ''' - ''' Run during the Clearing of the collection. - ''' The method actually clears the values safely - ''' so as not to cause exceptions. Triggered via - ''' the last Disconnected event. - ''' - Private Sub ClearAllValues() - While _values.Count > 0 - If _clearOK AndAlso _clearRemoval.Count > 0 Then - Dim i As Integer = _values.Count - Dim gid2Rem As Guid = CType(_clearRemoval.Dequeue(), Guid) - _values.Remove(gid2Rem) - OnCountChanged(i, _values.Count) - End If - End While - End Sub - - ''' - ''' Attemps to retrieve the GUID of the item at the index specified. - ''' - ''' The zero-based index of the GUID you are attempting to find. - Private Function getGID(ByVal index As Integer) As Guid - Return CType(List.Item(index), Guid) - End Function - - ''' - ''' Attempts to retrieve the GUID of the item using the Key given to the item. - ''' - ''' The key whose GUID you are looking for. - Private Function getGID(ByVal key As Object) As Guid - For Each gid As Guid In _keys.Keys - If Object.ReferenceEquals(_keys(gid), key) Then Return gid - Next - Return Guid.Empty - End Function - - ''' - ''' Removes the given GUID and it's ties from the collections. - ''' - ''' The GUID to remove. - Private Sub RemoveGID(ByVal gid As Guid) - If gid <> Guid.Empty Then - CType(_values(gid), Winsock).Dispose() - _values.Remove(gid) - _keys.Remove(gid) - List.Remove(gid) - End If - End Sub - - ''' - ''' Adds a winsock value to the collection. - ''' - ''' The GUID of the object. - ''' The Key of the object (may be nothing). - ''' The Winsock that is to be added to the collection. - ''' Attaches handlers to each Winsock event so the collection can act as a proxy. - Private Sub Add(ByVal gid As Guid, ByVal key As Object, ByVal value As Winsock) - AddHandler value.Connected, AddressOf OnConnected - AddHandler value.ConnectionRequest, AddressOf OnConnectionRequest - AddHandler value.DataArrival, AddressOf OnDataArrival - AddHandler value.Disconnected, AddressOf OnDisconnected - AddHandler value.ErrorReceived, AddressOf OnErrorReceived - AddHandler value.SendComplete, AddressOf OnSendComplete - AddHandler value.SendProgress, AddressOf OnSendProgress - AddHandler value.StateChanged, AddressOf OnStateChanged - _keys.Add(gid, key) - _values.Add(gid, value) - List.Add(gid) - End Sub - - ''' - ''' Method to remove an object automatically - threaded to avoid problems. - ''' - Private Sub RemovalThread() - Threading.Thread.Sleep(50) - Dim gid As Guid = CType(_autoRemoval.Dequeue(), Guid) - RemoveGID(gid) - End Sub - -#End Region - -#Region " Public Methods " - - ''' - ''' Retrieves the GUID assigned to the specified Winsock object in the collection. - ''' - ''' The Winsock object to find the GUID of. - Public Function findGID(ByVal value As Winsock) As Guid - If Not ContainsValue(value) Then Return Guid.Empty - For Each gid As Guid In _values.Keys - If Object.ReferenceEquals(_values(gid), value) Then Return gid - Next - Return Guid.Empty - End Function - - ''' - ''' Retrieves the Key assigned to the specified Winsock object in the collection. - ''' - ''' The Winsock object to find the Key of. - ''' The key object that was assigned to the Winsock - may be Nothing. - Public Function findKey(ByVal value As Winsock) As Object - Dim gid As Guid = findGID(value) - If gid = Guid.Empty Then Return Nothing - Return _keys(gid) - End Function - - ''' - ''' Determines if the collection contains the key specified. - ''' - ''' The key to search the collection for. - Public Function ContainsKey(ByVal key As Object) As Boolean - If key Is Nothing Then - Throw New ArgumentNullException("key") - End If - Return _keys.ContainsValue(key) - End Function - - ''' - ''' Determines if the collection contains the specified value. - ''' - ''' The value to search the collection for. - Public Function ContainsValue(ByVal value As Winsock) As Boolean - Return _values.ContainsValue(value) - End Function - - ''' - ''' Removes the value at the specified index. Use this instead of RemoveAt. - ''' - ''' The zero-based index of the item you wish to remove. - Public Sub Remove(ByVal index As Integer) - Dim gid As Guid = getGID(index) - RemoveGID(gid) - End Sub - - ''' - ''' Removes the value with the specified key. - ''' - ''' The key of the value you wish to remove. - Public Sub Remove(ByVal key As Object) - If TypeOf (key) Is Integer Then - Dim gidIndex As Guid = getGID(CInt(key)) - RemoveGID(gidIndex) - Exit Sub - End If - If Not ContainsKey(key) Then Exit Sub - Dim gid As Guid = getGID(key) - RemoveGID(gid) - End Sub - - ''' - ''' Removes the value with the specified Guid. - ''' - ''' The Guid of the value you wish to remove. - Public Sub Remove(ByVal gid As Guid) - RemoveGID(gid) - End Sub - - ''' - ''' Adds a value to the collection. - ''' - ''' The Winsock object to add to the collection. - ''' Returns the GUID assigned to the element. - Public Function Add(ByVal value As Winsock) As Guid - Dim gid As Guid = Guid.NewGuid() - Add(gid, Nothing, value) - Return gid - End Function - ''' - ''' Adds a value to the collection. - ''' - ''' The Winsock object to add to the collection. - ''' The Key of the element to add. - ''' Returns the GUID assigned to the element. - Public Function Add(ByVal value As Winsock, ByVal key As Object) As Guid - Dim gid As Guid = Guid.NewGuid() - Add(gid, key, value) - Return gid - End Function - - ''' - ''' Accepts an incoming connection and adds it to the collection. - ''' - ''' The client to accept. - ''' Returns the GUID assigned to the element. - Public Function Accept(ByVal client As System.Net.Sockets.Socket) As Guid - Dim wsk As New Winsock() - wsk.LegacySupport = _legacySupport - Dim gid As Guid = Add(wsk, Nothing) - wsk.Accept(client) - Return gid - End Function - ''' - ''' Accepts an incoming connection and adds it to the collection. - ''' - ''' The client to accept. - ''' The Key of the element to add. - ''' Returns the GUID assigned to the element. - Public Function Accept(ByVal client As System.Net.Sockets.Socket, ByVal key As Object) As Guid - Dim wsk As New Winsock() - wsk.LegacySupport = _legacySupport - Dim gid As Guid = Me.Add(wsk, key) - wsk.Accept(client) - Return gid - End Function - - ''' - ''' Connects to a remote host and adds it to the collection. - ''' - ''' A containing the Hostname or IP address of the remote host. - ''' A value indicating the port on the remote host to connect to. - ''' Return the GUID assigned to the element. - Public Function Connect(ByVal remoteHostOrIP As String, ByVal remotePort As Integer) As Guid - Dim wsk As New Winsock() - wsk.Protocol = WinsockProtocol.Tcp - wsk.LegacySupport = _legacySupport - Dim gid As Guid = Add(wsk, Nothing) - CType(_values(gid), Winsock).Connect(remoteHostOrIP, remotePort) - End Function - ''' - ''' Connects to a remote host and adds it to the collection. - ''' - ''' A containing the Hostname or IP address of the remote host. - ''' A value indicating the port on the remote host to connect to. - ''' The Key of the element to add. - ''' Return the GUID assigned to the element. - Public Function Connect(ByVal remoteHostOrIP As String, ByVal remotePort As Integer, ByVal key As Object) As Guid - Dim wsk As New Winsock() - wsk.Protocol = WinsockProtocol.Tcp - wsk.LegacySupport = _legacySupport - Dim gid As Guid = Add(wsk, key) - CType(_values(gid), Winsock).Connect(remoteHostOrIP, remotePort) - End Function - - ''' - ''' Gets an Array of all the remote IP addresses of each connection in this collection. - ''' - Public Function GetRemoteIPs() As ArrayList - Dim ar As New ArrayList - For Each key As Object In _values.Keys - ar.Add(CType(_values(key), Winsock).RemoteHost) - Next - Return ar - End Function - -#End Region - -#Region " Public Properties " - - ''' - ''' Gets a Collection containing all the keys in this collection. - ''' - Public ReadOnly Property Keys() As System.Collections.ICollection - Get - Return _keys.Values() - End Get - End Property - - ''' - ''' Gets a Collection containing all the values in this collection. - ''' - Public ReadOnly Property Values() As System.Collections.ICollection - Get - Return _values.Values - End Get - End Property - - ''' - ''' Gets or sets the Winsock at the specified index. - ''' - ''' A zero-based index of the Winsock to get or set. - Default Public Property Item(ByVal index As Integer) As Winsock - Get - Dim gid As Guid = getGID(index) - Return CType(_values(gid), Winsock) - End Get - Set(ByVal value As Winsock) - Dim gid As Guid = getGID(index) - If Not _values.ContainsKey(gid) Then - Add(gid, Nothing, value) - Else - _values(gid) = value - End If - End Set - End Property - - ''' - ''' Gets or sets the Winsock associated with the specified key. - ''' - ''' The key whose value to get or set. - Default Public Property Item(ByVal key As Object) As Winsock - Get - Dim gid As Guid = getGID(key) - Return CType(_values(gid), Winsock) - End Get - Set(ByVal value As Winsock) - Dim gid As Guid = getGID(key) - If Not _values.ContainsKey(gid) Then - Add(gid, Nothing, value) - Else - _values(gid) = value - End If - End Set - End Property - - ''' - ''' Gets or sets the Winsock associated with the specified GUID. - ''' - ''' The GUID whose value to get or set. - Default Public Property Item(ByVal gid As Guid) As Winsock - Get - Return CType(_values(gid), Winsock) - End Get - Set(ByVal value As Winsock) - If Not _values.ContainsKey(gid) Then - Add(gid, Nothing, value) - Else - _values(gid) = value - End If - End Set - End Property - -#End Region - -#Region " Events " - - ''' - ''' Occurs when connection is achieved (client and server). - ''' - Public Event Connected(ByVal sender As Object, ByVal e As WinsockConnectedEventArgs) - ''' - ''' Occurs on the server when a client is attempting to connect. - ''' - ''' Client registers connected at this point. Server must Accept in order for it to be connected. - Public Event ConnectionRequest(ByVal sender As Object, ByVal e As WinsockConnectionRequestEventArgs) - ''' - ''' Occurs when the number of items in the collection has changed. - ''' - Public Event CountChanged(ByVal sender As Object, ByVal e As WinsockCollectionCountChangedEventArgs) - ''' - ''' Occurs when data arrives on the socket. - ''' - ''' Raised only after all parts of the data have been collected. - Public Event DataArrival(ByVal sender As Object, ByVal e As WinsockDataArrivalEventArgs) - ''' - ''' Occurs when disconnected from the remote computer (client and server). - ''' - Public Event Disconnected(ByVal sender As Object, ByVal e As System.EventArgs) - ''' - ''' Occurs when an error is detected in the socket. - ''' - ''' May also be raised on disconnected (depending on disconnect circumstance). - Public Event ErrorReceived(ByVal sender As Object, ByVal e As WinsockErrorReceivedEventArgs) - ''' - ''' Occurs when sending of data is completed. - ''' - Public Event SendComplete(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - ''' - ''' Occurs when the send buffer has been sent but not all the data has been sent yet. - ''' - Public Event SendProgress(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - ''' - ''' Occurs when the state of the socket changes. - ''' - Public Event StateChanged(ByVal sender As Object, ByVal e As WinsockStateChangedEventArgs) - - ''' - ''' Triggers an event declared at module level within a class, form, or document in a thread-safe manner. - ''' - ''' The event to be raised. - ''' The arguements for the event. - Private Sub RaiseEventSafe(ByVal ev As System.Delegate, ByRef args() As Object) - Dim bFired As Boolean - If ev IsNot Nothing Then - For Each singleCast As System.Delegate In ev.GetInvocationList() - bFired = False - Try - Dim syncInvoke As ISynchronizeInvoke = CType(singleCast.Target, ISynchronizeInvoke) - If syncInvoke IsNot Nothing AndAlso syncInvoke.InvokeRequired Then - bFired = True - syncInvoke.BeginInvoke(singleCast, args) - Else - bFired = True - singleCast.DynamicInvoke(args) - End If - Catch ex As Exception - If Not bFired Then singleCast.DynamicInvoke(args) - End Try - Next - End If - End Sub - - ''' - ''' Raises the Connected event. - ''' - Protected Friend Sub OnConnected(ByVal sender As Object, ByVal e As WinsockConnectedEventArgs) - RaiseEventSafe(ConnectedEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the ConnectionRequest event, and closes the socket if the ConnectionRequest was rejected. - ''' - Protected Friend Sub OnConnectionRequest(ByVal sender As Object, ByVal e As WinsockConnectionRequestEventArgs) - RaiseEventSafe(ConnectionRequestEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the DataArrival event. - ''' - Protected Friend Sub OnDataArrival(ByVal sender As Object, ByVal e As WinsockDataArrivalEventArgs) - RaiseEventSafe(DataArrivalEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the Disconnected Event. - ''' - Protected Friend Sub OnDisconnected(ByVal sender As Object, ByVal e As System.EventArgs) - RaiseEventSafe(DisconnectedEvent, New Object() {sender, e}) - If _clearRemove Then - Dim gid As Guid = findGID(CType(sender, Winsock)) - _clearRemoval.Enqueue(gid) - If _clearRemoval.Count = _values.Count Then - Dim thd As New Threading.Thread(AddressOf ClearAllValues) - thd.Start() - _clearRemove = False - End If - ElseIf _autoRemove Then - Dim gid As Guid = findGID(CType(sender, Winsock)) - _autoRemoval.Enqueue(gid) - Dim thd As New Threading.Thread(AddressOf RemovalThread) - thd.Start() - End If - End Sub - - ''' - ''' Raises the ErrorReceived event. - ''' - Protected Friend Sub OnErrorReceived(ByVal sender As Object, ByVal e As WinsockErrorReceivedEventArgs) - RaiseEventSafe(ErrorReceivedEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the SendComplete event. - ''' - Protected Friend Sub OnSendComplete(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - RaiseEventSafe(SendCompleteEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the SendProgress event. - ''' - Protected Friend Sub OnSendProgress(ByVal sender As Object, ByVal e As WinsockSendEventArgs) - RaiseEventSafe(SendProgressEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the StateChanged event. - ''' - Protected Friend Sub OnStateChanged(ByVal sender As Object, ByVal e As WinsockStateChangedEventArgs) - RaiseEventSafe(StateChangedEvent, New Object() {sender, e}) - End Sub - - ''' - ''' Raises the count changed event. - ''' - Private Sub OnCountChanged(ByVal old_count As Integer, ByVal new_count As Integer) - Dim e As New WinsockCollectionCountChangedEventArgs(old_count, new_count) - RaiseEventSafe(CountChangedEvent, New Object() {Me, e}) - End Sub - -#End Region - -End Class \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/WinsockDesigner.vb b/Sub/WinsockOracs/Backup/WinsockDesigner.vb deleted file mode 100644 index bb8e916..0000000 --- a/Sub/WinsockOracs/Backup/WinsockDesigner.vb +++ /dev/null @@ -1,236 +0,0 @@ -Imports System.ComponentModel -Imports System.ComponentModel.Design -Imports Microsoft.VisualBasic - -''' -''' Winsock designer class provides designer time support for the Winsock component. -''' -Public Class WinsockDesigner - Inherits System.ComponentModel.Design.ComponentDesigner - - Private lists As DesignerActionListCollection - - ''' - ''' Creates a new instance of the WinsockDesigner class. - ''' - ''' - Public Sub New() - End Sub - - ''' - ''' Initializes this instance of the WinsockDesigner class. - ''' - ''' The base component of the designer. - Public Overrides Sub Initialize(ByVal component As System.ComponentModel.IComponent) - MyBase.Initialize(component) - End Sub - - ''' - ''' Gets the Verb collection. - ''' - ''' - ''' The Verb collection is used to display links at the - ''' bottom of the description in the Properties pane. - ''' - Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection - Get - Return New DesignerVerbCollection() - End Get - End Property - - ''' - ''' Gets the Action list collection. - ''' - ''' - ''' The Action list collection is used for the Smart Tag - ''' popup to provide easy access to various properties/actions. - ''' - Public Overrides ReadOnly Property ActionLists() As DesignerActionListCollection - Get - If lists Is Nothing Then - lists = New DesignerActionListCollection() - lists.Add(New WinsockActionList(Me.Component)) - End If - Return lists - End Get - End Property - -End Class - -''' -''' Provides the action list for the Winsock component during design time. -''' -Public Class WinsockActionList - Inherits DesignerActionList - - Private _wsk As Winsock - Private designerActionUISvc As DesignerActionUIService = Nothing - - Private host As IDesignerHost - Private parentDesigner As IDesigner - - ''' - ''' Initializes a new instance of the WinsockActionList class. - ''' - ''' The component used in initialization. - Public Sub New(ByVal component As IComponent) - MyBase.New(component) - Me._wsk = CType(component, Winsock) - - Me.designerActionUISvc = CType(GetService(GetType(DesignerActionUIService)), DesignerActionUIService) - - Me.host = Me.Component.Site.GetService(GetType(IDesignerHost)) - - Me.parentDesigner = host.GetDesigner(Me.Component) - End Sub - - ''' - ''' Gets or sets a value indicating if Legacy support should be used or not. - ''' - ''' Legacy support is to support older winsock style connections. - Public Property LegacySupport() As Boolean - Get - Return _wsk.LegacySupport - End Get - Set(ByVal value As Boolean) - GetPropertyByName("LegacySupport").SetValue(_wsk, value) - Me.designerActionUISvc.Refresh(Me.Component) - End Set - End Property - - ''' - ''' Gets or sets the winsock protocol to use when communicating with the remote computer. - ''' - Public Property Protocol() As WinsockProtocol - Get - Return _wsk.Protocol - End Get - Set(ByVal value As WinsockProtocol) - GetPropertyByName("Protocol").SetValue(_wsk, value) - Me.designerActionUISvc.Refresh(Me.Component) - End Set - End Property - - ''' - ''' Builds and retrieves the Action list itself. - ''' - Public Overrides Function GetSortedActionItems() As DesignerActionItemCollection - Dim items As New DesignerActionItemCollection() - - ' create the headers - items.Add(New DesignerActionHeaderItem("Appearance & Behavior")) - items.Add(New DesignerActionHeaderItem("Events")) - items.Add(New DesignerActionHeaderItem("About")) - - ' add the properties - items.Add(New DesignerActionPropertyItem("LegacySupport", "Legacy Support", "Appearance & Behavior", "Enables legacy (VB6) send/receive support.")) - items.Add(New DesignerActionPropertyItem("Protocol", "Protocol", "Appearance & Behavior", "Specifies whether the component should use the TCP or UDP protocol.")) - - ' add the events - items.Add(New DesignerActionMethodItem(Me, "TriggerConnectedEvent", "Connected", "Events", "Takes you to the handler for the Connected event.", False)) - items.Add(New DesignerActionMethodItem(Me, "TriggerConnectionRequestEvent", "ConnectionRequest", "Events", "Takes you to the handler for the ConnectionRequest event.", False)) - items.Add(New DesignerActionMethodItem(Me, "TriggerDataArrivalEvent", "DataArrival", "Events", "Takes you to the handler for the DataArrival event.", False)) - items.Add(New DesignerActionMethodItem(Me, "TriggerDisconnectedEvent", "Disconnected", "Events", "Takes you to the handler for the Disconnected event.", False)) - items.Add(New DesignerActionMethodItem(Me, "TriggerErrorReceivedEvent", "ErrorReceived", "Events", "Takes you to the handler for the ErrorReceived event.", False)) - items.Add(New DesignerActionMethodItem(Me, "TriggerStateChangedEvent", "StateChanged", "Events", "Takes you to the handler for the StateChanged event.", False)) - - ' add support items - Dim ver As String = String.Format("{0}.{1}.{2}", My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build) - items.Add(New DesignerActionMethodItem(Me, "ShowAbout", "About Winsock " & ver, "About", "Displays the about box.", False)) - items.Add(New DesignerActionMethodItem(Me, "LaunchWebSite", "Kolkman Koding Website", "About", "Opens the author's website.", False)) - - Return items - End Function - - ''' - ''' Gets the property information by the given name. - ''' - ''' The name of the property to get. - Private Function GetPropertyByName(ByVal propName As String) As PropertyDescriptor - Dim prop As PropertyDescriptor - prop = TypeDescriptor.GetProperties(_wsk)(propName) - If prop Is Nothing Then - Throw New ArgumentException("Invalid property.", propName) - Else - Return prop - End If - End Function - - ''' - ''' Shows the about box. - ''' - Public Sub ShowAbout() - Dim f As New frmAbout() - f.ShowDialog() - End Sub - - ''' - ''' Launches the author's website. - ''' - Public Sub LaunchWebSite() - System.Diagnostics.Process.Start("http://www.k-koding.com") - End Sub - - Public Sub TriggerConnectedEvent() - CreateAndShowEvent("Connected") - End Sub - Public Sub TriggerConnectionRequestEvent() - CreateAndShowEvent("ConnectionRequest") - End Sub - Public Sub TriggerDataArrivalEvent() - CreateAndShowEvent("DataArrival") - End Sub - Public Sub TriggerDisconnectedEvent() - CreateAndShowEvent("Disconnected") - End Sub - Public Sub TriggerErrorReceivedEvent() - CreateAndShowEvent("ErrorReceived") - End Sub - Public Sub TriggerStateChangedEvent() - CreateAndShowEvent("StateChanged") - End Sub - - Private Sub CreateAndShowEvent(ByVal eventName As String) - Dim evService As IEventBindingService = CType(Me.Component.Site.GetService(GetType(System.ComponentModel.Design.IEventBindingService)), IEventBindingService) - Dim ev As EventDescriptor = GetEvent(evService, eventName) - If ev IsNot Nothing Then - CreateEvent(evService, ev) - Me.designerActionUISvc.HideUI(Me.Component) - evService.ShowCode(Me.Component, ev) - End If - End Sub - - Private Sub CreateEvent(ByRef evService As IEventBindingService, ByVal ev As EventDescriptor) - Dim epd As PropertyDescriptor = evService.GetEventProperty(ev) - Dim strEventName As String = Me.Component.Site.Name & "_" & ev.Name - Dim existing As Object = epd.GetValue(Me.Component) - 'Only create if there isn't already a handler - If existing Is Nothing Then - epd.SetValue(Me.Component, strEventName) - End If - End Sub - - Private Function GetEvent(ByRef evService As IEventBindingService, ByVal eventName As String) As EventDescriptor - If evService Is Nothing Then Return Nothing - ' Attempt to obtain a PropertyDescriptor for a - ' component event named "testEvent". - Dim edc As EventDescriptorCollection = TypeDescriptor.GetEvents(Me.Component) - If edc Is Nothing Or edc.Count = 0 Then - Return Nothing - End If - Dim ed As EventDescriptor = Nothing - ' Search for an event named "Connected". - Dim edi As EventDescriptor - For Each edi In edc - If edi.Name = eventName Then - ed = edi - Exit For - End If - Next edi - If ed Is Nothing Then - Return Nothing - End If - Return ed - End Function - -End Class diff --git a/Sub/WinsockOracs/Backup/WinsockFileData.vb b/Sub/WinsockOracs/Backup/WinsockFileData.vb deleted file mode 100644 index cb091eb..0000000 --- a/Sub/WinsockOracs/Backup/WinsockFileData.vb +++ /dev/null @@ -1,83 +0,0 @@ -''' -''' A class that wraps a file allowing you to serialize it for transport. -''' - _ -Public Class WinsockFileData - -#Region " Private Members " - - Private _fileData() As Byte ' Stores the file data - Private _fileName As String ' Stores the file name - -#End Region - -#Region " Constructor " - - ''' - ''' Initializes a new instance of the WinsockFileData class. - ''' - Public Sub New() - _fileData = Nothing - _fileName = Nothing - End Sub - -#End Region - -#Region " Properties " - - ''' - ''' Gets or sets the name of the file. - ''' - Public Property FileName() As String - Get - Return _fileName - End Get - Set(ByVal value As String) - _fileName = value - End Set - End Property - - ''' - ''' Gets or sets the contents of the file. - ''' - Public Property FileData() As Byte() - Get - Return _fileData - End Get - Set(ByVal value As Byte()) - _fileData = value - End Set - End Property - -#End Region - -#Region " Methods " - - ''' - ''' Saves the file to the specified path. - ''' - ''' The full path of the file to save to. - ''' Whether you want to append the data to the end of an existing file or not. - Public Sub SaveFile(ByVal save_path As String, Optional ByVal append As Boolean = False) - My.Computer.FileSystem.WriteAllBytes(save_path, _fileData, append) - End Sub - - ''' - ''' Reads a file into the WinsockFileData class. - ''' - ''' The full path of the file you want to read. - Public Function ReadFile(ByVal file_path As String) As Boolean - Dim fi As IO.FileInfo = My.Computer.FileSystem.GetFileInfo(file_path) - If fi.Exists Then - ReDim _fileData(0) - _fileName = fi.Name - _fileData = My.Computer.FileSystem.ReadAllBytes(fi.FullName) - Else - Return False - End If - Return True - End Function - -#End Region - -End Class diff --git a/Sub/WinsockOracs/Backup/frmAbout.Designer.vb b/Sub/WinsockOracs/Backup/frmAbout.Designer.vb deleted file mode 100644 index 860a938..0000000 --- a/Sub/WinsockOracs/Backup/frmAbout.Designer.vb +++ /dev/null @@ -1,146 +0,0 @@ - _ -Partial Class frmAbout - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAbout)) - Me.pctLogo = New System.Windows.Forms.PictureBox - Me.txtAbout = New System.Windows.Forms.TextBox - Me.cmdClose = New System.Windows.Forms.Button - Me.TabControl1 = New System.Windows.Forms.TabControl - Me.TabPage1 = New System.Windows.Forms.TabPage - Me.TabPage2 = New System.Windows.Forms.TabPage - Me.txtHistory = New System.Windows.Forms.TextBox - CType(Me.pctLogo, System.ComponentModel.ISupportInitialize).BeginInit() - Me.TabControl1.SuspendLayout() - Me.TabPage1.SuspendLayout() - Me.TabPage2.SuspendLayout() - Me.SuspendLayout() - ' - 'pctLogo - ' - Me.pctLogo.Anchor = System.Windows.Forms.AnchorStyles.Top - Me.pctLogo.Image = Global.Winsock_Orcas.My.Resources.Resources.k_koding - Me.pctLogo.Location = New System.Drawing.Point(169, 12) - Me.pctLogo.Name = "pctLogo" - Me.pctLogo.Size = New System.Drawing.Size(121, 120) - Me.pctLogo.TabIndex = 0 - Me.pctLogo.TabStop = False - ' - 'txtAbout - ' - Me.txtAbout.Dock = System.Windows.Forms.DockStyle.Fill - Me.txtAbout.Location = New System.Drawing.Point(3, 3) - Me.txtAbout.Multiline = True - Me.txtAbout.Name = "txtAbout" - Me.txtAbout.ReadOnly = True - Me.txtAbout.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtAbout.Size = New System.Drawing.Size(420, 221) - Me.txtAbout.TabIndex = 1 - ' - 'cmdClose - ' - Me.cmdClose.Location = New System.Drawing.Point(371, 397) - Me.cmdClose.Name = "cmdClose" - Me.cmdClose.Size = New System.Drawing.Size(75, 23) - Me.cmdClose.TabIndex = 2 - Me.cmdClose.Text = "Close" - Me.cmdClose.UseVisualStyleBackColor = True - ' - 'TabControl1 - ' - Me.TabControl1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ - Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.TabControl1.Controls.Add(Me.TabPage1) - Me.TabControl1.Controls.Add(Me.TabPage2) - Me.TabControl1.Location = New System.Drawing.Point(12, 138) - Me.TabControl1.Name = "TabControl1" - Me.TabControl1.SelectedIndex = 0 - Me.TabControl1.Size = New System.Drawing.Size(434, 253) - Me.TabControl1.TabIndex = 3 - ' - 'TabPage1 - ' - Me.TabPage1.BackColor = System.Drawing.SystemColors.Control - Me.TabPage1.Controls.Add(Me.txtAbout) - Me.TabPage1.Location = New System.Drawing.Point(4, 22) - Me.TabPage1.Name = "TabPage1" - Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage1.Size = New System.Drawing.Size(426, 227) - Me.TabPage1.TabIndex = 0 - Me.TabPage1.Text = "About" - ' - 'TabPage2 - ' - Me.TabPage2.BackColor = System.Drawing.SystemColors.Control - Me.TabPage2.Controls.Add(Me.txtHistory) - Me.TabPage2.Location = New System.Drawing.Point(4, 22) - Me.TabPage2.Name = "TabPage2" - Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(426, 227) - Me.TabPage2.TabIndex = 1 - Me.TabPage2.Text = "History" - ' - 'txtHistory - ' - Me.txtHistory.Dock = System.Windows.Forms.DockStyle.Fill - Me.txtHistory.Location = New System.Drawing.Point(3, 3) - Me.txtHistory.Multiline = True - Me.txtHistory.Name = "txtHistory" - Me.txtHistory.ReadOnly = True - Me.txtHistory.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtHistory.Size = New System.Drawing.Size(420, 221) - Me.txtHistory.TabIndex = 0 - ' - 'frmAbout - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(458, 432) - Me.Controls.Add(Me.TabControl1) - Me.Controls.Add(Me.cmdClose) - Me.Controls.Add(Me.pctLogo) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog - Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmAbout" - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "About Winsock Orcas" - CType(Me.pctLogo, System.ComponentModel.ISupportInitialize).EndInit() - Me.TabControl1.ResumeLayout(False) - Me.TabPage1.ResumeLayout(False) - Me.TabPage1.PerformLayout() - Me.TabPage2.ResumeLayout(False) - Me.TabPage2.PerformLayout() - Me.ResumeLayout(False) - - End Sub - Friend WithEvents pctLogo As System.Windows.Forms.PictureBox - Friend WithEvents txtAbout As System.Windows.Forms.TextBox - Friend WithEvents cmdClose As System.Windows.Forms.Button - Friend WithEvents TabControl1 As System.Windows.Forms.TabControl - Friend WithEvents TabPage1 As System.Windows.Forms.TabPage - Friend WithEvents TabPage2 As System.Windows.Forms.TabPage - Friend WithEvents txtHistory As System.Windows.Forms.TextBox -End Class diff --git a/Sub/WinsockOracs/Backup/frmAbout.resx b/Sub/WinsockOracs/Backup/frmAbout.resx deleted file mode 100644 index 590829d..0000000 --- a/Sub/WinsockOracs/Backup/frmAbout.resx +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAQAEAAAAAAAAAAAAAAAAAAAAA - AAAAAAAA////ACJ6/wCioqIAeq//ALrc/wB/f38AxMTEAE2T/wCdxP8As7OzAI+PjwDP6/8AYqL/ADSI - /wCLuf8ArM7/AJmZmQCHh4cAvLy8AKqqqgBYmv8AcKj/ALnQ/wAtf/8AP4r/AJK//wCDtf8ApM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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAABQAAAAABgAAAAAAAAAAAAAK - FAMRCxIAAAAAAAAAAAAAAAoMJREAAAAAAAAAAAAAAAATChQDAAAAAAAAS1AVAAAAABcFAAAAADQONC4J - LQA2IQAHEwAvGAA5ODRRSD4ADUQAAAAAOkEAHioCPUMEAAAzAAAAAEwAAB8dQABJPAAALhsWOE4hAAAI - MAAAGjUmAAAAPh0AAAAITxkAAAAcRw8AAAAAAAAjP00AAAAAAEcQJEU9RjInKQQAAAAAAAAAOytCICwo - SiIAAAAAAAAAAAAAOzcxDwAAAAAAAP//AAD3/wAA+98AAPgfAAD8PwAA/D8AAB54AAASSAAAE8gAABvY - AACYGQAAjnEAAMfjAADgBwAA8A8AAPw/AAA= - - - \ No newline at end of file diff --git a/Sub/WinsockOracs/Backup/frmAbout.vb b/Sub/WinsockOracs/Backup/frmAbout.vb deleted file mode 100644 index 86087a4..0000000 --- a/Sub/WinsockOracs/Backup/frmAbout.vb +++ /dev/null @@ -1,24 +0,0 @@ -Public Class frmAbout - - Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click - Me.Close() - End Sub - - Private Sub frmAbout_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load - txtAbout.Text = ReadFromAssembly("About.txt") - txtHistory.Text = ReadFromAssembly("History.txt") - End Sub - - Private Function ReadFromAssembly(ByVal filename As String) As String - Dim sRet As String = "" - Dim executing_assembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly() - Dim my_namespace As String = GetType(frmAbout).Namespace - Dim text_stream As IO.Stream = executing_assembly.GetManifestResourceStream(my_namespace & "." & filename) - If text_stream IsNot Nothing Then - Dim stream_reader As New IO.StreamReader(text_stream) - sRet = stream_reader.ReadToEnd() - End If - Return sRet - End Function - -End Class \ No newline at end of file diff --git a/Sub/WinsockOracs/UpgradeLog.htm b/Sub/WinsockOracs/UpgradeLog.htm deleted file mode 100644 index a85531a..0000000 --- a/Sub/WinsockOracs/UpgradeLog.htm +++ /dev/null @@ -1,299 +0,0 @@ - - - - 마이그레이션 보고서 -

- 마이그레이션 보고서 -

개요

프로젝트경로오류경고메시지
Winsock OrcasWinsock Orcas.vbproj0028

솔루션 및 프로젝트

Winsock Orcas

메시지
- 표시 28 추가 메시지 -
Winsock Orcas.vbproj: - 프로젝트 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Winsock Orcas.vbproj(으)로 백업했습니다.
AsyncSocket.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\AsyncSocket.vb(으)로 백업했습니다.
My Project\AssemblyInfo.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\AssemblyInfo.vb(으)로 백업했습니다.
My Project\Application.Designer.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Application.Designer.vb(으)로 백업했습니다.
My Project\Resources.Designer.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Resources.Designer.vb(으)로 백업했습니다.
My Project\Settings.Designer.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Settings.Designer.vb(으)로 백업했습니다.
Enumerations.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Enumerations.vb(으)로 백업했습니다.
EventArgs.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\EventArgs.vb(으)로 백업했습니다.
frmAbout.Designer.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\frmAbout.Designer.vb(으)로 백업했습니다.
frmAbout.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\frmAbout.vb(으)로 백업했습니다.
IWinsock.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\IWinsock.vb(으)로 백업했습니다.
Deque.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Deque.vb(으)로 백업했습니다.
ObjectPacker.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\ObjectPacker.vb(으)로 백업했습니다.
SharedMethods.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\SharedMethods.vb(으)로 백업했습니다.
Winsock.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Winsock.vb(으)로 백업했습니다.
WinsockCollection.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\WinsockCollection.vb(으)로 백업했습니다.
WinsockDesigner.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\WinsockDesigner.vb(으)로 백업했습니다.
WinsockFileData.vb: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\WinsockFileData.vb(으)로 백업했습니다.
My Project\Application.myapp: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Application.myapp(으)로 백업했습니다.
My Project\Settings.settings: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Settings.settings(으)로 백업했습니다.
Resources\k-koding.png: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Resources\k-koding.png(으)로 백업했습니다.
My Project\Resources.resx: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\My Project\Resources.resx(으)로 백업했습니다.
History.txt: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\History.txt(으)로 백업했습니다.
frmAbout.resx: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\frmAbout.resx(으)로 백업했습니다.
Winsock.png: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\Winsock.png(으)로 백업했습니다.
About.txt: - 파일을 S:\Source\JDTEK\VMS2016\Sub\WinsockOracs\Backup\About.txt(으)로 백업했습니다.
Winsock Orcas.vbproj: - 프로젝트를 마이그레이션했습니다.
Winsock Orcas.vbproj: - 검사 완료: 프로젝트 파일을 마이그레이션할 필요가 없습니다.
- 숨기기 28 추가 메시지 -
\ No newline at end of file