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
Asked
Active
Viewed 460 times
0

Waheed Khan
- 1,323
- 6
- 18
- 28
1 Answers
0
It is possible and pretty easy, especially with C# and Java. Their implementation of sockets is pretty similar.
Few things to watch for:
- 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.
- Make sure you are encoding/decoding your strings consistently, like using Unicode on both sides.
- Don't try using
unsigned
integer types, Java only supports signed types (I'm sure there are libraries to deal with it if necessary). - I don't know how compatible
float
anddouble
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