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