jsocket icon indicating copy to clipboard operation
jsocket copied to clipboard

Add a factory to generate new connections

Open czifro opened this issue 9 years ago • 1 comments

A factory that could use ServerSockets to instantiate usable instances of a tcp based connection. A config could be provided so that instances are setup already with buffer sizes and services. Cleans up usage.

czifro avatar Dec 11 '16 03:12 czifro

Adding static methods to Connection would be the simplest option. There would need to be some initializing to do this. TCP uses a ServerSocket while UDP uses DatagramSocket. An enum called ProtocolType could be used to specify which needs initializing and also for which type Connection::getInstance should return. Doing this will slim down the code quite a bit and remove redundancies.

czifro avatar Apr 21 '17 23:04 czifro