REgarding sending data when using socket winsock
-
I am using a winsock control in my app. which create UDP socket.When I send the data using below code- Dim sendStr As String sendStr = "hello" wsClient.SendData sendStr Then on server side it shows a string of symbols. But when I send data as- wsClient.SendData "Hello" Then on server side it shows "Hello". What is the problem with first method.
-
I am using a winsock control in my app. which create UDP socket.When I send the data using below code- Dim sendStr As String sendStr = "hello" wsClient.SendData sendStr Then on server side it shows a string of symbols. But when I send data as- wsClient.SendData "Hello" Then on server side it shows "Hello". What is the problem with first method.
There is no problem with that code. The two snippets are identical. The problem would have to be somewhere else, or this isn't the exact code you're using. Also, are you saying that you're using the old Winsock control, or are you using the socket classes in System.Net?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak