Loop End Sub ' ADD DATA RECEIVED Protected Sub ActualizarTextoMensaje( ByVal sender As Object, ByVal e As System.EventArgs)ĭim parts() As String = line.Split( " |"c) LNetgames.Invoke( New EventHandler( AddressOf ActualizarTextoMensaje)) LaIPRemota = CType(IPRecibida, IPEndPoint) MsgBox( " Error '" & ex.ErrorCode.ToString & " ' " & ex.Message, MsgBoxStyle.Critical, " Error receiving data ")Įnd If End Try ' converts the endpoint type to ipendpoint with its respective variables If ex.ErrorCode = 10040 Then ' data too longĭatos &= " " ' add the string "" to the received text Else ' displays the error message
' converts them and saves it in the data variableĭatos = Encoding. ' Variable to store ip temporarily Dim IPRecibida As EndPoint = CType(LaIPRemota, EndPoint)ĭim RecibirBytes( 255) As Byte ' Buffer Dim Datos As String = " " ' Text a Show Try ' Receive the dataĮlSocket.ReceiveFrom(RecibirBytes, RecibirBytes.Length, SocketFlags.None, IPRecibida) ' Variable to get the IP of the sender machine Dim LaIPRemota As New IPEndPoint(IPAddress.Any, 0) ' As long as the output indicator is not true Do Until Saliendo ' WE RECEIVE THE SUBMITTED DATA Private Sub RecibirDatos() ' Variable that indicates whether the program is closing Dim Saliendo As Boolean = False ' Temporary variables to store received data Dim DireccIP As String, ContenidoMensaje As String #End Region ' Variable that contains the thread in charge of receiving the data Dim HiloRecibir As Thread ' Object variable containing the socket Dim ElSocket As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp) We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.Doing so will get you kicked off and banned. Do not be abusive, offensive, inappropriate or harass anyone on the boards.Likewise, do not post the same question in more than one forum. Please do not post links to your question into an unrelated forum such as the lounge.
Everyone here helps because they enjoy helping others, not because it's their job. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Do not remove or empty a message if others have replied.Typing mistakes can become the focal point instead of the actual question you asked. Be careful when including code that you haven't made a typo.If you have to include code, include the smallest snippet of code you can. Keep the question as brief as possible.Keep the subject line brief, but descriptive.Pinpoint exactly what it is you need help with. Be specific! Don't ask "can someone send me the code to create an application that does 'X'.Posting a VB.NET question in the C++ forum will end in tears. Choose the correct forum for your message.For those new to message boards please try to follow a few simple rules when posting your question.