Git Product home page Git Product logo

socketpro's Introduction

SocketPro

简介

SocketPro是一个提供 socket 通讯的工具库,当开发者需要做服务端或客户端的调试时,可以接入本库快速实现一个简单的客户端服务端,以帮助开发者实现socket通讯联调。
SocketPro包含的通讯类型有:TCP,UDP,netty实现tcp,udp通讯,mina实现tcp长连接

使用说明

一. 库依赖

在你project对应的buid.gradle中添加如下代码:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

在你要使用的module对应的buid.gradle中添加如下代码(以0.0.1版本为例):

	dependencies {
	        implementation 'com.github.ShaoqiangPei:SocketPro:0.0.1'
	}

在你项目的自定义Application类中对本库Log打印做控制:

   //开启log打印
   SocketUtil.setDebug(true);

二. 主要功能类

2.1 TCP通讯

TcpClient ———— tcp客户端工具类
TcpServer ———— tcp服务端工具类

2.2 UDP通讯

UdpClient ———— udp客户端工具类
UdpServer ———— udp服务端工具类

2.3 Netty实现TCP通讯

TnClient ———— netty实现tcp客户端工具类
TnServer ———— netty实现tcp服务端工具类

2.4 Netty实现UDP通讯

UnClient ———— netty实现udp客户端工具类
UnServer ———— netty实现udp服务端工具类

2.5 Mina实现tcp长连接

TmClientManager ———— mina实现tcp长连接客户端工具类
TmServerManager ———— mina实现tcp长连接服务端工具类

socketpro's People

Contributors

shaoqiangpei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.