Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a VB6 client and server written using WinSock and everything works fine.

I am developing a .NET application(Visual Studio 2008).
Can I use TCPclient as client to connect to server in WinSock?
Posted
Comments
Sergey Alexandrovich Kryukov 18-Oct-12 12:04pm    
I'm just curious: is there any single reason to use such trash as VB6?
--SA

1 solution

Yes, absolutely. You only need to develop your application-level protocol and match is on both client and server sides. You need to make sure that your different types (managed and unmanaged) serialize and deserialize in an identical way.

One of the ways to do it in these different technologies is to reduce serialization to a sequence of primitive types of the same size and pass them in their binary form. As nearly all systems use IEEE 754 standard for floating-point types and two's complement for integer types; and because you can use the same encoding for serialized texts, all the data will be interpreted correctly. You can also exchange text messages, but you would need to have identical text generation and parsing on both sides, might be not very efficient in case of complex parsing (even if you merely parse numbers). It could be XML, JSON, or anything else.

Please see:
http://en.wikipedia.org/wiki/Application_layer[^],
http://en.wikipedia.org/wiki/IEEE_floating_point[^],
http://en.wikipedia.org/wiki/Two%27s_complement[^].

—SA
 
Share this answer
 
v2
Comments
Ashok26 6-Nov-12 11:19am    
Haven't got the installation done yet.
Will update once I am able to test it.

But I have one question: As per your solution, we would have to implement serializing in VB6 code too, right?
Sergey Alexandrovich Kryukov 6-Nov-12 13:08pm    
Yes, but: is there any single reason to use such trash as VB6?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900