473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

TCP Socket

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?
Nov 21 '05 #1
3 1368
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
Nov 21 '05 #2
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???

"rawCoder" <ra******@hotmail.com> wrote in message
news:uI*************@TK2MSFTNGP12.phx.gbl...
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

Nov 21 '05 #3
try vbcrlf instead of vbcr

Lou wrote:
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???

"rawCoder" <ra******@hotmail.com> wrote in message
news:uI*************@TK2MSFTNGP12.phx.gbl...

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



Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: simon place | last post by:
Spent some very frustrating hours recoding to find a way of closing a server socket, i'd not thought it would be any problem, however, after complete failure and as a last resort, i looked at the...
4
by: DreJoh | last post by:
I've read many articles on the subject and the majority of them give the same solution that's in article 821625 on the MSDN website. I'm using the following code and when a the client disconnects...
6
by: roger beniot | last post by:
I have a program that launches multiple threads with a ThreadStart method like the following (using System.Net.Sockets.Socket for UDP packet transfers to a server): ThreadStart pseudo code: ...
4
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
2
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless...
0
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a...
3
by: BuddyWork | last post by:
Hello, Could someone please explain why the Socket.Send is slow to send to the same process it sending from. Eg. Process1 calls Socket.Send which sends to the same IP address and port, the...
5
by: darthghandi | last post by:
I've created a class to listen to all interfaces and do a BeginAccept(). Once it gets a connection, it passes the connected socket off and stores it in a List. Next, it continues to listen for...
4
by: O.B. | last post by:
I have a socket configured as TCP and running as a listener. When I close socket, it doesn't always free up the port immediately. Even when no connections have been made to it. So when I open...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.