The Netty provides two encoders (Protobufencoder,protobufvarint32lengthfieldprepender) for the Protobuf, Two decoders (Protobufvarint32framedecoder,protobufdecoder)[note] The so-called encoding is to encode the data type used by the application into a binary byte stream transmitted over the network, and vice versa.Look at an example of a Netty official online that uses protobuf:Localtimeprotocol.proto file: [Java] View Plain copy print? packageorg.jbo
First, add the Protobuf jar package to the Pom.xml .
serialized entity Class User.java (no need to implement Serializable interface)
Package com.serialize.entity;
public class User {
private String ID;
Private String username;
private String password;
Public user () {
} public
User (string ID, string username, string password) {
this.id = ID;
This.username = Username;
This.password = password;
}
Public String getId () {
re
Java protobuf2.6 Source code is missing Com.google.protobuf.DescriptorProtos;In fact, this class needs to be built with tools,In the Redeme.txt file there is a description,CD Java copies protoc to this directory to perform Protoc--java_out=src/main/java-i. /src. /src/google/protobuf/descriptor.proto's going to generate Descriptorprotos.This article is from the "one-day effort" blog, please be sure to keep this source http://java711.blog.51cto.com/1786
There are 2 ways to Generate-protobuf in Maven
1 is a MAVEN plugin that uses PROTOBUF, but the author is the Maven2 plugin for the development, and has not been updated for 2 years
So I chose the second method is to use the Mavn ant plug-in, the entire configuration and ant very much like, a little adjustment can be configured as follows
The lifecycle is tied to generate-sources, as long as Maven generat
What is Protobuf
A data storage and transmission format, used for structured data, has the advantages of compact structure, small footprint, fast structure, good expansibility, and platform and language independent.
Use steps
1. Define the proto file (structure description) 2. Generate the implementation of the corresponding language (Java, etc.) 3. The data stream is generated into the proto format data Flow 4. Receiver-side Analytic data Example
Netty4 and protocol buffer combination simple tutorial, netty4buffer
Binary communication is usually used between various projects, which requires a small bandwidth and fast processing speed ~
Thanks to Trustin Lee, the author of netty, for letting netty naturally support protocol buffer.
This example uses netty4 + protobuf-2.5.0, run in win7, and assuming jdk and maven have been installed.
1. Download and
Preach Wisdom Blog Video tutorial Download summary |java video tutorial |net video tutorial |php video tutorial | Web video Tutorial
Preach Wisdom Blog Video tutorial Download summary |java video
Unity Client Architecture design and network game key technologies (Avatar, hot update, PROTOBUF)Course Category: Game developmentSuitable for people: intermediateNumber of lessons: 20 (42 sessions)Using technology: Unity client, UI design framework, Avatar Dressup, protobuf-net, etc.Project: Build Unity client UI design framework and Avatar Dressup and mobile-end hot new technology implementations and
http://blog.csdn.net/sealyao/article/details/69402451. Serialization and deserialization API for C arrays[CPP]View Plaincopy
Serialization and serialization API for C arrays
BOOL Parsefromarray (const void* data, int size);
BOOL
Communication between the two systems, one end acting as the role of the client and the other acting as the role of the server.In my project, the Java side acts as a client, communicates with C + + servers, uses sockets to implementReferring to a
I will not go into details about the usage instructions in many places. Here I will only talk about some details, that is, what I made a mistake.
I checked a lot of information today and did not solve the problem. I am writing it now to help the
Recently because the project logic is almost done, so hurriedly to do the test work, so that the project on the line after the problem, so I intend to use the form of configuration to do a similar and white box test tool out of things.Because the
Here is an introduction to paste http://blog.csdn.net/hailong0715/article/details/52016682
Here on how to install the installation of the Caffe installed together, here to introduce how to use this library, Caffe use him as a data transmission means
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.