Send message to PPC from PC using sockets (Error 10060) [modified]
-
Hello all Im trying to send an alert to a WM6 Device (Emulator) from my PC Code on PC:
Dim tcpClient As New Sockets.TcpClient
Dim portNumber As Integer = 1414 '????
'ERROR10060 on next line
tcpClient.Connect(New IPEndPoint(IPAddress.Parse("192.168.55.101"), portNumber))Code on PPC:
Private Sub listener()
Dim tcpListener As New Sockets.TcpListener(IPAddress.Parse("192.168.55.101"), 1414)
tcpListener.Start()While (True) ' Look for notification If (tcpListener.Pending()) Then ' Get notification message Dim tcpClient As Sockets.TcpClient = tcpListener.AcceptTcpClient() Dim s As IO.Stream = tcpClient.GetStream() Dim buffer(250) As Byte Dim bytes As Int16 = s.Read(buffer, 0, buffer.Length) Dim message As String = System.Text.Encoding.ASCII.GetString(buffer, 0, bytes) ' Send back confirmation Dim response As String = "OK" Dim responseBytes() As Byte = System.Text.Encoding.ASCII.GetBytes(response.ToCharArray()) tcpClient.GetStream().Write(responseBytes, 0, responseBytes.Length) tcpClient.Close() showNotification(message) End If System.Threading.Thread.Sleep(1000) End While End Sub
What am i suppossed to write on the port number?? I have tried several numbers but all of them give me the same error 10060 To get that IP address i run this code on my PPC 'Dns.GetHostEntry(Dns.GetHostName()).AddressList(0).ToString Thanks in advance for any answers -- modified at 15:36 Thursday 4th October, 2007
Alexei Rodriguez
-
Hello all Im trying to send an alert to a WM6 Device (Emulator) from my PC Code on PC:
Dim tcpClient As New Sockets.TcpClient
Dim portNumber As Integer = 1414 '????
'ERROR10060 on next line
tcpClient.Connect(New IPEndPoint(IPAddress.Parse("192.168.55.101"), portNumber))Code on PPC:
Private Sub listener()
Dim tcpListener As New Sockets.TcpListener(IPAddress.Parse("192.168.55.101"), 1414)
tcpListener.Start()While (True) ' Look for notification If (tcpListener.Pending()) Then ' Get notification message Dim tcpClient As Sockets.TcpClient = tcpListener.AcceptTcpClient() Dim s As IO.Stream = tcpClient.GetStream() Dim buffer(250) As Byte Dim bytes As Int16 = s.Read(buffer, 0, buffer.Length) Dim message As String = System.Text.Encoding.ASCII.GetString(buffer, 0, bytes) ' Send back confirmation Dim response As String = "OK" Dim responseBytes() As Byte = System.Text.Encoding.ASCII.GetBytes(response.ToCharArray()) tcpClient.GetStream().Write(responseBytes, 0, responseBytes.Length) tcpClient.Close() showNotification(message) End If System.Threading.Thread.Sleep(1000) End While End Sub
What am i suppossed to write on the port number?? I have tried several numbers but all of them give me the same error 10060 To get that IP address i run this code on my PPC 'Dns.GetHostEntry(Dns.GetHostName()).AddressList(0).ToString Thanks in advance for any answers -- modified at 15:36 Thursday 4th October, 2007
Alexei Rodriguez