In short I'm creating a Flash based multiplayer game and I'm now starting to work on the server-side code. Well I'm the sole developer of the project so I'm seeking a high-level socket library that works well with games to speed up my development time.
I was trying to use the Twisted Framework (for Python) but I'm having some personal issues with it so I'm looking for another solution.
I'm open to either Java or a Python based library. The main thing is that the library is stable enough for multiplayer games and the library needs to be "high-level" (abstract) since I'm new to socket programming for games.
I want to also note that I will be using the raw binary socket for my Flash game (Actionscript 3.0) since I assume it will be faster than the traditional Flash XML socket.
-
2You may elaborate what you exactly understand with "high-level library for socket programming" as sockets aren't hight-level. Do you search for a network or middleware (library)?tuergeist– tuergeist2009年11月13日 09:58:15 +00:00Commented Nov 13, 2009 at 9:58
-
Actually over the past few months I have been spending some of my free time looking into socket programming (in general) and it's very mind-boggling and I actually WANT to make my own socket server in C but I want to get this game out to beta asap. As for me searching... yes I have, python it seemed like Twisted was a no-brainier but for Java I'm not sure... I've programmed a few little client-server things using Java's default socket lib. but it was much different than programming a socket server for a game.CodeJustin.com– CodeJustin.com2009年11月13日 10:11:06 +00:00Commented Nov 13, 2009 at 10:11
-
@CodeJustin.com: Please do not COMMENT on your own question. You own the question. Please UPDATE the question with the additional facts.S.Lott– S.Lott2009年11月13日 12:24:18 +00:00Commented Nov 13, 2009 at 12:24
-
I know you have already accepted an answer, but would you consider looking at my Java library: github.com/czifro-development/JSocketczifro– czifro2015年08月05日 19:14:25 +00:00Commented Aug 5, 2015 at 19:14
-
You might check out this (which mentions a bunch of frameworks, modules and such): wiki.python.org/moin/ConcurrencyBrōtsyorfuzthrāx– Brōtsyorfuzthrāx2017年09月26日 05:20:17 +00:00Commented Sep 26, 2017 at 5:20
4 Answers 4
An option for Python is the Concurrence framework. I used it fairly recently, in conjunction with Stackless Python, to simulate an environment in which there were potentially thousands of requests per second, each of which had to be processed in less than 2 seconds. The API is very straightforward and is well documented.
I came very close to implementing in Java using Netty, which is a JBoss project.
3 Comments
See "A Quick Guide to ActionScript 3 and Flash Programming". It has a detailed example of an ActionScript client code using sockets to communicate with a Python server (code included). Not what anyone will call high-level, it makes use of the basic Python socket module for communication.
(Note: the Python server example is not pythonic. After getting the general idea of using sockets in Python, write something simpler and NO from socket import * )
3 Comments
High-level on one side and raw binary sockets on the other won't work. Sorry, but you'll need to go low-level on the server side too.
EDIT: in response to the OP's comment. I am not aware of any "high level" interface of the nature that you are talking about for Java. And frankly I don't think it makes a lot of sense. If you are going to talk bytes over Socket streams you really do need to understand the standard JDK Socket / ServerSocket APIs; e.g. timeouts, keep-alive, etc.
4 Comments
For java there is Apache mina and Grizzly frameworks both of those really simplify work with sockets