Problemi invio messaggi in una lan

lunedì 14 dicembre 2009 - 12.17

vaccarasso Profilo | Newbie

Gentilissimi,
ho questo codice:

Public Function SendMsg(ByVal Msg As String) As Boolean
Dim tcpClient As New System.Net.Sockets.TcpClient()
Dim IsErr As Boolean = False
Dim MsgErr As String = ""
tcpClient.SendTimeout = 1000

Try
tcpClient.Connect(pIndIp, PPorta)
Catch ex As Exception
IsErr = True
If ex.GetType Is GetType(SocketException) Then
Dim exx As SocketException = CType(ex, SocketException)
Select Case exx.SocketErrorCode
Case SocketError.ConnectionRefused
MsgErr = "Il Pc: " & pIndIp & " non è in ascolto."
Case SocketError.TimedOut
MsgErr = "Il Pc: " & pIndIp & " non ha risposto prima del TimeOut"
Case Else
MsgErr = exx.Message
End Select
Else
MsgErr = ex.Message
End If
RaiseEvent AfterSendMsg(MsgErr, IsErr)
If tcpClient IsNot Nothing Then
tcpClient.Close()
End If
Return False
End Try
End sub

Su vista va bene, mentre su LAN Windows XP si ferma a : il PC non è in ascolto
Potreste aiutarmi?
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5