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

1 Answer 1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.