pvdberg1998 / pnet Goto Github PK
View Code? Open in Web Editor NEWHigh level Java network library
License: MIT License
High level Java network library
License: MIT License
Would you welcome a PR with a gradle build file for this?
I like the PNet API design.
I saw this.
https://github.com/PvdBerg1998/PNet/blob/master/src/test/java/nl/pvdberg/pnet/BenchmarkTest.java
It is only tested on 1 client 1 server.
Multi client 1 server has not been tested.
In the case of multiple clients, depending on the implementation, a large number of threads are created, or if some communication is delayed, the whole is delayed.
How much performance do you get?
Hi,
I have created one server and two clients.
Server:
server = new PlainServer();
server.setListener(new ServerListener());
server.start(10240);
Client 1:
client1 = new PlainClient();
client1.setClientListener(new ClientListener());
client1.connect("localhost", 10240);
Client 2:
client2 = new PlainClient();
client2.setClientListener(new ClientListener());
client2.connect("localhost", 10240);
I can send a packet from Client 1 to the Server with:
packet1 = new PacketBuilder(Packet.PacketType.Request).withInt(10).withString("test").withBoolean(true).build();
client1.send(packet1);
But I'm not sure on how send this packet to Client 2? ๐ค
(ServerListener()
and ClientListener()
are both an implementation of PNetListener
)
Hi, I had a pretty hard time to debug some code in my handlePacket method and I wonder if there is any reason why you are using e.getMessage() instead of just passing the exception to print the entire stack trace?
That would make things much easier to debug, so for example instead of
logger.error("Error in listener thread: {} : {}", e.getClass(), e.getMessage());
just use logger.error("Error in listener thread: {} : {}", e.getClass(), e);
Performance gain : usage of coroutines vs threads per client
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.