# ColinSocket **Repository Path**: colinhu2015/ColinSocket ## Basic Information - **Project Name**: ColinSocket - **Description**: 封装Java中TCP/UDP Socket的开发模块。从而简单的实现TCP/UDP服务器的开发。 - **Primary Language**: Java - **License**: EPL-1.0 - **Default Branch**: ColinSocket - **Homepage**: http://git.oschina.net/colinhu2015/ColinSocket/blob/ColinSocket/README.md?dir=0&filepath=README.md&oid=e59a347915a59e2f0fc05a6d18cb6c0ab1bd5270&sha=1eac3a6506e6c0a8154861a490a368d155f144d0 - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 1 - **Created**: 2015-07-26 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #ColinSocket It includes several classes and one interface definition to simplify the development of TCP/UDP server and TCP/UDP client. For example: to Create a TCP server. public class TCPServer implements SessionEvent { public TCPServer(int port) { server_socket = new SessionServer( SocketUtils.TCP_TYPE_NAME, port, this); server_socket.start_listen(); } @Override public synchronized void session_connect_event(SocketAddress remote_address) { //Please add code for a TCP client is connected. } @Override public void session_close_event(SocketAddress remote_address) { //Please add the code for what to do after the TCP connection is closed. } @Override public void session_read_event(SocketAddress remote_address, byte[] data, int length) { //Please add code for parsing received data here. } }