Good TCP Connection Library for Java?

I am looking for a good library of TCP connections from Java with the following features:

1. Retry on failed publishes 2. Multiple connections 

Which library have you used successfully.

EDIT: Based on the comment, the question has changed to reflect the type of connection library.

+4
source share
3 answers

Maybe Apache MINA will help you. Take a look.

+4
source

I'm not sure if that really makes sense. You are talking about retrying attempts to publish, but TCP has no concept of publishing. Easy messaging. This way you can publish or you can request information.

eg. HTTP over TCP has the verbs GET / PUT / POST (among others). All of them work through TCP. Only two actually write something (PUT / POST). It is assumed that only PUT is idempotent (that is, you should be able to perform the same operation again and again with the same result). If you have repeatedly added POSTed, I would like to re-publish something and create a new version on the server for each POST.

And the above are only recommendations for implementing PUT / POST. I would not want the HTTP library to accept this on my behalf.

Thus, the concept of resending messages at the TCP level is erroneous (note that TCP will send packets, etc., when composing a message). This is a higher level function that can use TCP at a lower level. for example, I wrote my own wrappers around HTTPClient to repeat PUTting when my remote server is temporarily unavailable or reports an error (I'm not sure if there is a repeated HTTP library)

+1
source

Perhaps this will help others, try this library called socketal , Pure Java uses ServerSocket and Socket , it is quite simple and has no unnecessary function.

This library is capable of:

  • Disconnect Auto Connect
  • Ability to control the connection / disconnection / connection
  • Pretty simple to send String , Object or File
  • Set your own Authentication code and Verification as Login Password

Netty seems to be, but they don't have that much complicated setup and features.

It is compatible for Android/Java .

0
source

All Articles