Tidying up!
Monkey Forums/Monkey Programming/Tidying up!
| ||
Hi, I'm just working on finishing up brl.socket and would like to get some idea of what people are already doing with the existing networking stuff. In particular, are you using any of the following, and if so how/what for? * TcpStream * AsyncStream * AsyncTcpStream * AsyncTcpConnector |
| ||
Was using HttpRequest to connect to http://www.gameanalytics.com and it was using TcpStream behind the scenes. I intend to take a look at the new socket stuff (sounds great!) and I'll be back with comments if I have any :) One thing I would prefer is if the networking stuff allowed for easier testability (mocking). |
| ||
I definitely use that non-blocking async stuff. TCP is enough for me, atm I don't need UDP. What I would LOVE to see is that I can create a server application with Monkey as well! In that case something like listening on a port for incoming connections and all that stuff which is necessary for a server would be awesome. Actually I don't think this makes sense for any mobile devices but it would be great for the stdcpp and the GLFW targets. |
| ||
I just need to connect to a TCPServer using TCPStream. All the code that call TCPStream is in the file: https://github.com/Ferddi/pbnet-monkey/blob/master/src/pbnet/core/networkconnection.monkey It is called TCPSocket in that file ... sorry for the confusion. I called it TCPSocket because I needed 2 additional methods. One to return the "state" variable and the other SetupSocket, so I can reuse TCPStream code for TCPServer. Hope that make sense. So yeah, once brl.socket is finalise, I will update NetworkConnection.monkey accordingly. I'll figure it out eventually/hopefully =) |
| ||
HttpRequest used here too. Just so I can get highscores from an online php page with get/post. |
| ||
My apps are fetching game levels from my server via HttpRequest(). Or they are sending game status to the server, which stores it... The target-"adress" is always a *.php-script, which expects additional parameters, like... http://www.mygame.com/game.php?Id=5&Lev=1 ...the answer is a html content returned by the server. That's all I need. |