#What's a good library for creating TCP servers?

1 messages · Page 1 of 1 (latest)

marsh trench
#

There are lots of libraries for writing TCP servers like Java IO, Java NIO, Netty, Mina, Coral Reactor etc.

I'm not sure what to use or learn for creating an instant messaging and voip platform. I did some Google research but got mixed results on what I should be using, could you guys give me some advice? Any recommendations for the framework I should use? My initial thought is Mina because it's by Apache and they make good stuff, right?

proud solsticeBOT
#

<@&987246452180930620> please have a look, thanks.

proud solsticeBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

faint lark
#

Don't use Apache Mina, it's not in development and the author moved onto the Netty project a few years ago

#

Netty would be the best choice but it's a little complicated to wrap your head around, my suggestion would be to use https://vertx.io/ - it's a pretty straightforward library to use, open-source, the networking stuff is based on Netty anyway

#

Netty is the biggest library for socket programming though but as I mentioned already, vertx for yourself would be the best choice. I default to it for every project I make (since it's a toolkit first)

marsh trench
#

Sure I will look at vertx, can you give me a snippet of code so I can have a feel of how it looks like?

faint lark
#

?

#

You mean code to make a sever?

marsh trench
#

Thanks, i will read it

steady fossil
#

A mincraft server used TCP protocol, SSH, all protocols are built on TCP

#

I think they're trying to write their own server to send raw data

faint lark
#

You can create a HTTP server using Vertx though using the WebClient

#

I'm talking about Vert NetSocket which uses Netty

marsh trench
#

@faint lark I did some looking into it and vertx seems great, can you explain what a verticle is and what the eventbus does?

#

I don't understand the point of them

faint lark
#

verticle is what you should use when creating something in vertx and it's used mainly to setup your system e.g. if you have a tcp server, you'll create a TcpVerticle which contains all the logic for that or if you have a web server, a HttpVerticle. They're really good because it allows for concurrency between each component of your program (vertx handles that for you), allows you to modularize your code and scaling, you can tell vertx to deploy like 5 instances of a verticle which it then will load balance depending

#

the scaling bit is fantastic built in functionality, helping you get the most out of system resources

#

eventbus is used to communicate between all your verticles

#

think Kafka

#

1 thing to point out is that vertx is polyglot and you can interop different verticles (that could be in different languages on different systems) and message between them using the eventbus

#

constrained to what vertx supports though like java, js, ruby etc.

marsh trench
#

that's actually sick lol