libgdx/libgdx — pull request #49 by noblemaster (2012-10-01 05:02:54+00:00)
Title: gdx.net: first set of changes!

Here are my first set of changes for cross-platform networking on libgdx. I implemented the socket connection functionality over java.net.*.

Request for feedback:

1) not sure about naming all those hint variables. I wonder what Mono uses? My naming matches what Java offers though but they seem quite inconsistent with the TCP specs. Sometimes following the TCP specs naming convention, other times not? Sometimes it's called "soTimeout", sometimes just "timeout". Anyhow, I followed the Java naming, the only thing I didn't follow was the soTimeout (server hints). I think calling it "acceptTimeout" is a lot clearer?

2) I implemented the classes for the LWJGL backend. This will be the exact same for Android. How would I go about that without producing duplicate code?

3) we should add a newServerSocket/newClientSocket without the hints? No hints meaning to use the platform defaults. I already check if hints if null and if it is null it will simply use the defaults on the platform.

Please note I haven't tested it at all (sorry, didn't have time yet). It should compile just fine. Not sure if you should merge it just yet? I am mainly posting it to gather some feedback.