0

I want to build a client and server application using Socket programming that can chat but the client and server has to be implemented in different languages.
I want to use C# and Java for that purpose. I want to know if its possible and if it is How?
Thanks

Waheed Khan
  • 1,323
  • 6
  • 18
  • 28

1 Answers1

0

It is possible and pretty easy, especially with C# and Java. Their implementation of sockets is pretty similar.

Few things to watch for:

  1. Make sure you are serializing integers in network order. If I remember correctly Java and .NET put bytes on the wire in a different order. See this post for some guidance.
  2. Make sure you are encoding/decoding your strings consistently, like using Unicode on both sides.
  3. Don't try using unsigned integer types, Java only supports signed types (I'm sure there are libraries to deal with it if necessary).
  4. I don't know how compatible float and double serializations are on both sides, so if you need it do some more investigation.

Good luck and have fun!

Community
  • 1
  • 1
Krzysztof Kozielczyk
  • 5,887
  • 37
  • 28