|
Hi all,
I'm trying to develop a web service that uses winsockets to connect to a server, and allow me to send and receive data from it. The thing is that I already have the code and the logic to make this work in windows form, but when I wrote the same code into a web service, when it tries to execute the segment which tries to connect to that external server, I receive a "No Such Host is Known" error message in the web browser.
Also when I try to connect to a server that is inside my network , it executes the Connect Method perfectly, and send and received data fine. The weird thing is that in windows application is works fine but not in the web service.
Does anyone could help?
Thanks so much,
Here is the code:
Dim tcpClient As New System.Net.Sockets.TcpClient
'Here is where the error is displayed
tcpClient.Connect("sms.lleida.net", 2048)
Dim networkStream As NetworkStream = tcpClient.GetStream()
Dim sms As String
sms = "1 LOGIN username password" & vbLf
sms = "3 SUBMIT" + " " + phone + " " + message & vbLf
SendData = Socket(networkStream, tcpClient, sms)
Bezabeth Rosado
|
|
|
|