Java multi-server communication framework progress-added the protobuf Command Parsing Function

Source: Internet
Author: User

The multi-server communication framework written in Java is basically formed. In order to provide multi-language support for the Framework, it can support communication with clients developed in multiple languages. Currently, Flash, Java, C language. Google protocol buffer is used for comprehensive consideration. Previously, protobuf was used in game server development projects. It seems that it is a little less functional than ice, but because it is a Google company, there are more people using it than ice.

1. Download

Protobuf

Address: http://code.google.com/p/protobuf/downloads/list

Refer supports C, Java, and python. protobuf-2.4.0a.zip is used here for selecting the support for as3.

As3

There are many protobuf library projects that support as3 on the network, but it is not ideal if you have selected a few projects.Protoc-gen-as3, and want to rewrite an impulse, but unfortunately no time.

Address: http://code.google.com/p/protoc-gen-as3/downloads/list

The latest development package contains the Java package 2.4.0a. Therefore, this version of protobuf is also selected.

2. Deployment

For ease of operation, I put these libraries in a project and run them using BAT. The specific project structure is as follows:

Click Run. BAT to generate a JavaCodeYou only need to introduce this project to the developed project.

After reading this, do you know what I want to do next?

Currently, a problem occurs: protobuf has no inheritance relationships and cannot express the inheritance relationships such as command and clientcommand in my original Java code. At present, although it can be implemented, the method is still not elegant, you need to be more familiar with protobuf in the future, or wait for protobuf to add support for the inheritance relationship before making improvements.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.