TCP Socket

L

Lou

I have a VB6 client app that I send data using the winsock control.
Buffer = "<xml>" & _
"<command>GetSomething</command>" & _
"</xml>" & vbCr
Buffer = StrConv(Buffer, vbUnicode)

'Winsock 0 is the gateway socket
If Winsock(0).state = sckConnected Then
Winsock(0).SendData Buffer
End If

WORKS GREAT!

Now in VB .NET I TRY
Private Sub SendData()

data = "<xml>" & _

"<command>GetSomething</command>" & _

"</xml>" & vbCr

Dim test As Encoding = Encoding.Unicode

Dim bytearray As Byte() = test.GetBytes(data)

Dim writer As New IO.StreamWriter(client.GetStream)

writer.Write(bytearray)

writer.Flush()

End Sub

THE SERVER APP DOESN'T RESPOND,

It does show the app is connected but somehow the data is different?

any ideas?
 
R

rawCoder

Apparently you dont have access to server.
If you have, you better look what its expecting and what its receiving
there.

Can you try Socket.Send method instead of TCPClient's stream methods.
For no particular reason ofcourse :)

HTH
rawCoder
 
L

Lou

i do dhave access, i do get a connection, its something in th encoding..I
think.
i don't see a "Send" method Of .NETS Socket
Private client As TcpClient

Client.Send doesn't exist???
 
S

Supra

try vbcrlf instead of vbcr
i do dhave access, i do get a connection, its something in th encoding..I
think.
i don't see a "Send" method Of .NETS Socket
Private client As TcpClient

Client.Send doesn't exist???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top