精华内容
下载资源
问答
  • 很强大的TCP UDP Socket调试工具。TCP Server,TCP Client,UDP Server,UDP Client,自动发送,支持ASCII码和HEX格式。
  • linux c tcpserver tcpclient udpserver udpclient select:包括tcpserver并发多客户端连接和数据收发;
  • 内部包含了java各个服务器的代码,可以随时利用,方便快捷本项目是用neteans开发的如果,如果ide不一致可以将代码和jar包拷贝到自己的项目中应用
  • 1. 有人串口调试助手和网络调试助手合二为一,特别适合调试网络设备。 2. 支持中文和英文双语言,再也不用愁找不到合适的串口调试软件给国际客户用了。 3. 最小化时停留在右下角,不占用任务栏位置,需要时一键调入...
  • socket 工具,tcp/udp client/server ,界面简洁好用,一直用的就是这个了。
  • udp server client demo

    2017-11-17 14:01:19
    udp消息通信的服务器端和客户端代码,在局域网内,启用此demo来通信,如传递ip地址,断开,或者其他消息等
  • udp client server

    2017-11-18 22:33:56
    udp client 和 server段代码, 直接编译可以正常运行,在嵌入式局域网内很有帮助,用于传递一些相关消息等!
  • c# sqlserver UDP聊天系统

    2010-04-16 11:39:17
    c# SQL UDP 聊天 系统 ,在测试环境测试通过 数据库用户和密码sa,sa ,需要更多系统请与 QQ:591127904联系,开源提供
  • udpserver 封装类

    2018-10-27 15:34:39
    可以运行的udp server 已封装好 ,顺便带了git上的hisocket工程 两者可以参考。
  • 下面是UDPServer项目里面的udpServer.cpp的代码 //作者:刘日辉 //时间:2019-5-9 //用途:UDP教学 #include "stdafx.h" #include #include #pragma comment(lib, "ws2_32.lib") int main(int argc, char* ...

    下面是UDPServer项目里面的udpServer.cpp的代码

    //作者:刘日辉
    //时间:2019-5-9
    //用途:UDP教学
    
    #include "stdafx.h"
    #include <stdio.h>
    #include <winsock2.h>
    
    #pragma comment(lib, "ws2_32.lib") 
    
    int main(int argc, char* argv[])
    {
    	//初始化WSA
        WSADATA wsaData;
    	//创建两个字节的word格式
        WORD sockVersion = MAKEWORD(2,2);
    	//WSAStartup用来初始化winsock的DLL库,执行成功后返回0,失败后则返回socket_error
        if(WSAStartup(sockVersion, &wsaData) != 0)
        {
            return 0;
        }
    	//创建套接字
    	//socket(int af,int type,int protocol)
    	//af 是通信协议的类型,type创建套接字的类型,protocol取决于第二个参数用于指定套接字的协议
    	//函数成功后返回套接字描述符,失败返回socket_error
        SOCKET serSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); 
    	//INVALID英文含义是无效的
        if(serSocket == INVALID_SOCKET)
        {
            printf("socket error !");
            return 0;
        }
    	//绑定IP和端口
    	//sockaddr_in,该结构体把port和addr 分开储存在两个变量中,如下:
    	/*
    	struct sockaddr_in
    	{
    		sa_family_t		sin_family;//地址族(Address Family)
    		unit16_t		sin_port;//16位TCP/UDP端口号
    		struct in_addr	sin_addr;//32位IP地址
    		char			sin_zero[8];//不使用
    	 }
    	 struct in_addr
    	 {
    		In_addr_t	s_addr;//32位IPV4地址
    	 }
    	*/
        sockaddr_in serAddr;
        serAddr.sin_family = AF_INET;
        serAddr.sin_port = htons(8888);
        serAddr.sin_addr.S_un.S_addr = INADDR_ANY;
    	/*
    	bind(sockt s,const struct socketaddr * name,int namelen),执行成功返回0,
    	否则返回socket_error
    	name 指定了结构体的套接字地址,namelen是地址结构的长度
    	*/
        if(bind(serSocket, (sockaddr *)&serAddr, sizeof(serAddr)) == SOCKET_ERROR)
        {
            printf("bind error !");
            closesocket(serSocket);
            return 0;
        }
        //新建一个套接字结构体数据
        sockaddr_in remoteAddr;
    	//获取结构体的存储容量
        int nAddrLen = sizeof(remoteAddr);
    	//循环接收数据
        while (true)
        {
    		/*接收数据
    		recvfrom(socket s,char *buf,int len,int flags,const char * from ,int fromlen)
    		用于接受数据报套接字的数据,
    		s是接收端套接字,
            buf 指定接收端等待接受数据的缓冲区,
    		len 指定要接受的数据的字节数,
    		flags指定要附加的标志位,通常flags设置为0,
    		from指定存放发送端等待发送数据的缓冲区,
    		fromlen指定要发送数据的字节数。
    		函数执行成功后返回接收数据的字节数,失败后返回socket_error
    		*/
    
            char recvData[255];  
            int ret = recvfrom(serSocket, recvData, 255, 0, (sockaddr *)&remoteAddr, &nAddrLen);
            if (ret > 0)
            {
    			//0x00是16进制的写法,含义是0
    			//ret是接收数据的长度,我们初始定义的revData长度是255,
    			//下面一句话的意思是让超过ret后面的内容为空
                recvData[ret] = 0x00;
                printf("接受到一个连接:%s \r\n", inet_ntoa(remoteAddr.sin_addr));
                printf(recvData);            
            }
    		 //发送数据
            char * sendData = "一个来自服务端的UDP数据包\n";
    		/*
    		sendto(socket s,const char *buf,int flags,const char * to,int tolen)
    		用于发送数据,s是发送端套接字描述符,
            buf指定发送端等待发送数据的缓冲区,
    		len指定要发送数据的字节数,
    		flags指定需要附加的标志位,
            通常flags设置为0,
    		to指定存放接收端等待接收数据的缓冲区,
    		tolen指定要接收数据的字节数。
    		函数执行成功后返回发送数据的字节数,失败后返回socket_error
    		*/
            sendto(serSocket, sendData, strlen(sendData), 0, (sockaddr *)&remoteAddr, nAddrLen);    
    
        }
    	//关闭监听的套接字,并释放套接字所占用的资源
        closesocket(serSocket); 
    	/*
    	卸载winsocket的dll,操作系统会解除应用程序与socket dll 库的绑定,
        并释放socket dll 库所占用的系统资源
    	*/
        WSACleanup();
        return 0;
    }

    下面是UDpClient里面的udpClent.cpp代码及解析:

    //作者:刘日辉
    //时间:2019-5-9
    //用途:UDP教学
    
    #include "stdafx.h"
    #include <stdio.h>
    #include <winsock2.h>
    
    #pragma comment(lib, "ws2_32.lib") 
    
    int main(int argc, char* argv[])
    {
    	//初始化WSA
    	//创建两个字节的word格式
        WORD socketVersion = MAKEWORD(2,2);
    	//创建一个结构,用来存储被WSAStartup函数调用后返回的Windows Sockets数据
        WSADATA wsaData; 
    	//WSAStartup用来初始化winsock的DLL库,执行成功后返回0,失败后则返回socket_error
        if(WSAStartup(socketVersion, &wsaData) != 0)
        {
            return 0;
        }
    	//socket(int af,int type,int protocol)
    	//af 是通信协议的类型,type创建套接字的类型,protocol取决于第二个参数用于指定套接字的协议
    	//函数成功后返回套接字描述符,失败返回socket_error
        SOCKET sclient = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
        //sockaddr_in,该结构体把port和addr 分开储存在两个变量中,如下:
    	/*
    	struct sockaddr_in
    	{
    		sa_family_t		sin_family;//地址族(Address Family)
    		unit16_t		sin_port;//16位TCP/UDP端口号
    		struct in_addr	sin_addr;//32位IP地址
    		char			sin_zero[8];//不使用
    	 }
    	 struct in_addr
    	 {
    		In_addr_t	s_addr;//32位IPV4地址
    	 }
    	*/
        sockaddr_in sin;
        sin.sin_family = AF_INET;
        sin.sin_port = htons(8888);
        sin.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
        int len = sizeof(sin);
        
        char * sendData = "来自客户端的数据包.\n";
    	/*
    		sendto(socket s,const char *buf,int flags,const char * to,int tolen)
    		用于发送数据,s是发送端套接字描述符,
            buf指定发送端等待发送数据的缓冲区,
    		len指定要发送数据的字节数,
    		flags指定需要附加的标志位,
            通常flags设置为0,
    		to指定存放接收端等待接收数据的缓冲区,
    		tolen指定要接收数据的字节数。
    		函数执行成功后返回发送数据的字节数,失败后返回socket_error
    		*/
        sendto(sclient, sendData, strlen(sendData), 0, (sockaddr *)&sin, len);
    
        char recvData[255];  
    	/*接收数据
    		recvfrom(socket s,char *buf,int len,int flags,const char * from ,int fromlen)
    		用于接受数据报套接字的数据,
    		s是接收端套接字,
            buf 指定接收端等待接受数据的缓冲区,
    		len 指定要接受的数据的字节数,
    		flags指定要附加的标志位,通常flags设置为0,
    		from指定存放发送端等待发送数据的缓冲区,
    		fromlen指定要发送数据的字节数。
    		函数执行成功后返回接收数据的字节数,失败后返回socket_error
    		*/
        int ret = recvfrom(sclient, recvData, 255, 0, (sockaddr *)&sin, &len);
        if(ret > 0)
        {
    		//0x00是16进制的写法,含义是0
    		//ret是接收数据的长度,我们初始定义的revData长度是255,
    		//下面一句话的意思是让超过ret后面的内容为空
            recvData[ret] = 0x00;
            printf(recvData);
        }
    	//关闭监听的套接字,并释放套接字所占用的资源
        closesocket(sclient);
    	/*
    	卸载winsocket的dll,操作系统会解除应用程序与socket dll 库的绑定,
        并释放socket dll 库所占用的系统资源
    	*/
        WSACleanup();
        return 0;
    }

     

    转载于:https://my.oschina.net/u/4082616/blog/3055988

    展开全文
  • java UDP Server

    2016-01-04 21:16:58
    用JAVA写的一个基于UDP协议的服务器程序。用来实现点到点之间的通信。支持多线程。
  • * 环境中的所有主机操作系统均为win2008Server x64 128G,CPU 32核 2.8GHz * 一台主机发送数据(通过UDP组播),其它主机接收 * 发送数据的主机开启8路组播端口,每路发送数据很均匀为51.2MBps。(总数据量为8x...
  • 这是一个安卓端采用udp协议实现数据的发送和接受的demo
  • Netty UDP Client & Server

    万次阅读 热门讨论 2018-01-31 17:47:48
    netty 客户端和服务器UDP通信 NettyUdpServer package com.vrv.cems.service.logpush.core; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; import io.netty.channel....

    netty 客户端和服务器UDP通信

    NettyUdpServer

     

    package com.vrv.cems.service.logpush.core;
    
    import io.netty.bootstrap.Bootstrap;
    import io.netty.channel.Channel;
    import io.netty.channel.ChannelInitializer;
    import io.netty.channel.ChannelOption;
    import io.netty.channel.ChannelPipeline;
    import io.netty.channel.nio.NioEventLoopGroup;
    import io.netty.channel.socket.nio.NioDatagramChannel;
    
    /**
     * 	 <B>说	明<B/>:UdpServer
     * 
     * @author 作者名:冯龙淼
     * 		   E-mail:fenglongmiao@vrvmail.com.cn
     * 
     * @version 版   本  号:1.0.<br/>
     *          创建时间:2018年1月8日 上午10:03:38
     */
    public class UdpServer {
    
    	private final Bootstrap bootstrap;
    	private final NioEventLoopGroup acceptGroup;
    	private Channel channel;
    	public void start(String host,int port) throws Exception{
            try {
            	channel = bootstrap.bind(host, port).sync().channel();
            	System.out.println("UdpServer start success"+port);
            	channel.closeFuture().await();
            } finally {
                acceptGroup.shutdownGracefully();
            }
    	}
    	
    	public Channel getChannel(){
    		return channel;
    	}
    	
    	public static UdpServer getInstance(){
    		return UdpServerHolder.INSTANCE;
    	}
    	
    	private static final class UdpServerHolder{
    		static final UdpServer INSTANCE = new UdpServer();
    	}
    	
    	private UdpServer(){
    		bootstrap = new Bootstrap();
    		acceptGroup = new NioEventLoopGroup();
    		bootstrap.group(acceptGroup)
            .channel(NioDatagramChannel.class)
            .option(ChannelOption.SO_BROADCAST, true)
            .handler(new ChannelInitializer<NioDatagramChannel>() {
    			@Override
    			protected void initChannel(NioDatagramChannel ch)
    					throws Exception {
    				ChannelPipeline pipeline = ch.pipeline();
    				pipeline.addLast(new UdpServerHandler());
    			}
    		});
    	}
    }
    

    UdpServerHandler

     

    package com.vrv.cems.service.logpush.core;
    
    import io.netty.buffer.ByteBuf;
    import io.netty.buffer.Unpooled;
    import io.netty.channel.ChannelHandlerContext;
    import io.netty.channel.SimpleChannelInboundHandler;
    import io.netty.channel.socket.DatagramPacket;
    
    import org.apache.log4j.Logger;
    
    /**
     * 	 <B>说	明<B/>:
     * 
     * @author 作者名:冯龙淼
     * 		   E-mail:fenglongmiao@vrvmail.com.cn
     * 
     * @version 版   本  号:1.0.<br/>
     *          创建时间:2018年1月8日 上午10:09:47
     */
    public class UdpServerHandler extends SimpleChannelInboundHandler<DatagramPacket>{
    
    	private static final Logger logger = Logger.getLogger(UdpServerHandler.class);
    	
    	@Override
    	protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg)
    			throws Exception {
    		// 接受client的消息
    		logger.info("开始接收来自client的数据");
    		final ByteBuf buf = msg.content();
        	int readableBytes = buf.readableBytes();
        	byte[] content = new byte[readableBytes];
    	    buf.readBytes(content);
    	    String clientMessage = new String(content,"UTF-8");
    		logger.info("clientMessage is: "+clientMessage);
    		if(clientMessage.contains("UdpServer")){
    			ctx.writeAndFlush(new DatagramPacket(Unpooled.wrappedBuffer("helloClient".getBytes()),msg.sender()));
    		}
    	}
    
    }
    


    NettyUdpClient

     

    package com.vrv.cems.service.logpush.core;
    
    import io.netty.bootstrap.Bootstrap;
    import io.netty.channel.Channel;
    import io.netty.channel.ChannelInitializer;
    import io.netty.channel.ChannelOption;
    import io.netty.channel.ChannelPipeline;
    import io.netty.channel.nio.NioEventLoopGroup;
    import io.netty.channel.socket.nio.NioDatagramChannel;
    
    import java.nio.charset.Charset;
    
    /**
     * 	 <B>说	明<B/>:LogPush UDP client
     * 
     * @author 作者名:冯龙淼
     * 		   E-mail:fenglongmiao@vrvmail.com.cn
     * 
     * @version 版   本  号:1.0.<br/>
     *          创建时间:2017年12月28日 下午3:37:53
     */
    public class LogPushUdpClient {
    	
    	private final Bootstrap bootstrap;
    	public final NioEventLoopGroup workerGroup;
    	public static Channel channel;
    	private static final Charset ASCII = Charset.forName("ASCII"); 
    	
    	public void start() throws Exception{
            try {
            	channel = bootstrap.bind(1234).sync().channel();
            	channel.closeFuture().await(1000);
            } finally {
    //        	workerGroup.shutdownGracefully();
            }
    	}
    	
    	public Channel getChannel(){
    		return channel;
    	}
    	
    	public static LogPushUdpClient getInstance(){
    		return logPushUdpClient.INSTANCE;
    	}
    	
    	private static final class logPushUdpClient{
    		static final LogPushUdpClient INSTANCE = new LogPushUdpClient();
    	}
    	
    	private LogPushUdpClient(){
    		bootstrap = new Bootstrap();
    		workerGroup = new NioEventLoopGroup();
    		bootstrap.group(workerGroup)
            .channel(NioDatagramChannel.class)
            .option(ChannelOption.SO_BROADCAST, true)
            .handler(new ChannelInitializer<NioDatagramChannel>() {
    			@Override
    			protected void initChannel(NioDatagramChannel ch)throws Exception {
    				ChannelPipeline pipeline = ch.pipeline();
    //				pipeline.addLast(new StringDecoder(ASCII))  
    //                .addLast(new StringEncoder(ASCII))
    				pipeline.addLast(new LogPushUdpClientHandler());
    			}
    		});
    	}
    	
    }
    


    ClientHandler

    package com.vrv.cems.service.logpush.core;
    
    import io.netty.buffer.ByteBuf;
    import io.netty.buffer.Unpooled;
    import io.netty.channel.Channel;
    import io.netty.channel.ChannelFuture;
    import io.netty.channel.ChannelHandlerContext;
    import io.netty.channel.SimpleChannelInboundHandler;
    import io.netty.channel.socket.DatagramPacket;
    import io.netty.util.concurrent.GenericFutureListener;
    
    import java.net.InetSocketAddress;
    import java.nio.charset.Charset;
    import java.util.List;
    
    import org.apache.log4j.Logger;
    
    /**
     * 	 <B>说	明<B/>:
     * 
     * @author 作者名:冯龙淼
     * 		   E-mail:fenglongmiao@vrvmail.com.cn
     *
     * @version 版   本  号:1.0.<br/>
     *          创建时间:2017年12月21日 下午4:20:49
     */
    public class LogPushUdpClientHandler extends SimpleChannelInboundHandler<DatagramPacket>{
    
    	private static final Logger logger = Logger.getLogger(LogPushUdpClientHandler.class);
    	
    //	private static Channel channel = LogPushUdpClient.getInstance().getChannel();
    	
    	@Override  
        public void channelActive(ChannelHandlerContext ctx) throws Exception {  
            //当channel就绪后。  
           logger.info("client channel is ready!");  
    //       ctx.writeAndFlush("started");//阻塞直到发送完毕  这一块可以去掉的 
    //       NettyUdpClientHandler.sendMessage("你好UdpServer", new InetSocketAddress("127.0.0.1",8888));
    //       sendMessageWithInetAddressList(message);
    //       logger.info("client send message is: 你好UdpServer");
        }
    	
    	@Override
    	protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket packet)
    			throws Exception {
    		// TODO 不确定服务端是否有response 所以暂时先不用处理
    		final ByteBuf buf = packet.content();
        	int readableBytes = buf.readableBytes();
        	byte[] content = new byte[readableBytes];
    	    buf.readBytes(content);
    	    String serverMessage = new String(content);
    		logger.info("reserveServerResponse is: "+serverMessage);
    	}
    
    	
    	
    	/**
    	 * 向服务器发送消息
    	 * @param msg 按规则拼接的消息串
    	 * @param inetSocketAddress 目标服务器地址
    	 */
    	public static void sendMessage(final String msg,final InetSocketAddress inetSocketAddress){
    		if(msg == null){
    			throw new NullPointerException("msg is null");
    		}
    		// TODO 这一块的msg需要做处理 字符集转换和Bytebuf缓冲区
    		senderInternal(datagramPacket(msg, inetSocketAddress));
    	}
    	
    	/**
    	 * 发送数据包并监听结果
    	 * @param datagramPacket
    	 */
    	public static void senderInternal(final DatagramPacket datagramPacket,List<Channel> channelList) {
    		for (Channel channel : NettyTCPClient.channelList) {
    			if(channel != null){
    				channel.writeAndFlush(datagramPacket).addListener(new GenericFutureListener<ChannelFuture>() {
    					@Override
    					public void operationComplete(ChannelFuture future)
    							throws Exception {
    						boolean success = future.isSuccess();
    						if(logger.isInfoEnabled()){
    							logger.info("Sender datagramPacket result : "+success);
    						}
    					}
    				});
    			}
    		}
    	}
    	
    	/**
    	 * 组装数据包
    	 * @param msg 消息串
    	 * @param inetSocketAddress 服务器地址
    	 * @return DatagramPacket
    	 */
    	private static DatagramPacket datagramPacket(String msg, InetSocketAddress inetSocketAddress){
    		ByteBuf dataBuf = Unpooled.copiedBuffer(msg,Charset.forName("UTF-8"));
    		DatagramPacket datagramPacket = new DatagramPacket(dataBuf, inetSocketAddress);
    		return datagramPacket;
    	}
    	
    	/**
    	 * 发送数据包服务器无返回结果
    	 * @param datagramPacket
    	 */
    	private static void senderInternal(final DatagramPacket datagramPacket) {
    		logger.info("LogPushUdpClient.channel"+LogPushUdpClient.channel);
    		if(LogPushUdpClient.channel != null){
    			LogPushUdpClient.channel.writeAndFlush(datagramPacket).addListener(new GenericFutureListener<ChannelFuture>() {
    				@Override
    				public void operationComplete(ChannelFuture future)
    						throws Exception {
    					boolean success = future.isSuccess();
    					if(logger.isInfoEnabled()){
    						logger.info("Sender datagramPacket result : "+success);
    					}
    				}
    			});
    		}else{
    			throw new NullPointerException("channel is null");
    		}
    	}
    	
    }
    

    MainTest

     

    package com.vrv.cems.service.logpush.core;
    
    import java.net.InetSocketAddress;
    
    import org.apache.log4j.Logger;
    import org.junit.Test;
    
    
    /**
     * 	 <B>说	明<B/>:
     * 
     * @author 作者名:冯龙淼
     * 		   E-mail:fenglongmiao@vrvmail.com.cn
     * 
     * @version 版   本  号:1.0.<br/>
     *          创建时间:2018年1月8日 上午10:25:21
     */
    public class UdpMainTest {
    
    	private static final Logger logger = Logger.getLogger(UdpServerMainTest.class);
    	
    	private static final String host = "192.168.133.72";
    	
    	private static final int port = 888;
    	
    	public static void main(String[] args) {
    		try {
    			UdpServer.getInstance().start(host, port);
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    	
    	@Test
    	public void logPushSendTest() throws Exception{
    		LogPushUdpClient.getInstance().start();
    		int i = 0;
    		while( i < 10){
    			LogPushUdpClientHandler.sendMessage(new String("你好UdpServer"), new InetSocketAddress(host,port));
    		    logger.info(i+" client send message is: 你好UdpServer");
    		    i++;
    		}
    	}
    	
    }
    

    结果 client

     

    [18/01/31 17:37:57:785][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelActive(LogPushUdpClientHandler.java:36)] client channel is ready!
    [18/01/31 17:37:58:823][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:831][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 0 client send message is: 你好UdpServer
    [18/01/31 17:37:58:832][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:832][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 1 client send message is: 你好UdpServer
    [18/01/31 17:37:58:833][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:834][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 2 client send message is: 你好UdpServer
    [18/01/31 17:37:58:834][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:834][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 3 client send message is: 你好UdpServer
    [18/01/31 17:37:58:835][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:835][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 4 client send message is: 你好UdpServer
    [18/01/31 17:37:58:835][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:836][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 5 client send message is: 你好UdpServer
    [18/01/31 17:37:58:836][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:836][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 6 client send message is: 你好UdpServer
    [18/01/31 17:37:58:837][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:839][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 7 client send message is: 你好UdpServer
    [18/01/31 17:37:58:840][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:840][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 8 client send message is: 你好UdpServer
    [18/01/31 17:37:58:841][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.senderInternal(LogPushUdpClientHandler.java:109)] LogPushUdpClient.channel[id: 0x1ccb53de, L:/0.0.0.0:11200]
    [18/01/31 17:37:58:841][ INFO][com.vrv.cems.service.logpush.core.UdpServerMainTest.logPushSendTest(UdpServerMainTest.java:40)] 9 client send message is: 你好UdpServer
    [18/01/31 17:37:58:857][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:860][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:861][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:861][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:862][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:862][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:863][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:863][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:863][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:864][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler$2.operationComplete(LogPushUdpClientHandler.java:117)] Sender datagramPacket result : true
    [18/01/31 17:37:58:866][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:867][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:867][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:869][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:869][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:870][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    [18/01/31 17:37:58:870][ INFO][com.vrv.cems.service.logpush.core.LogPushUdpClientHandler.channelRead0(LogPushUdpClientHandler.java:52)] reserveServerResponse is: helloClient
    

    结果 server

     

     

    UdpServer start success888
    [18/01/31 17:36:23:266][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:275][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:36:23:289][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:290][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:36:23:290][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:291][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:36:23:291][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:291][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:36:23:292][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:292][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:36:23:293][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:36:23:293][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:856][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:856][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:860][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:861][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:864][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:864][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:865][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:865][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:866][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:866][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:867][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:867][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:867][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:868][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:869][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:869][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer
    [18/01/31 17:37:58:870][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:28)] 开始接收来自client的数据
    [18/01/31 17:37:58:870][ INFO][com.vrv.cems.service.logpush.core.UdpServerHandler.channelRead0(UdpServerHandler.java:34)] clientMessage is: ??UdpServer

     

     

     

     

     

     

    展开全文
  • STM32Cube_LWIP_ UDP server

    2020-01-03 13:50:45
    STM32Cube_LWIP_ UDP serverudp server,需要PC和设备在同一网段,然后将PC的端口设置成设备里制定的远传端口。就可以通信了。
  • UDP Server服务器端 Demo

    热门讨论 2016-05-19 13:25:05
    Android Studio 下写的UDP客户端通信demo ,Gradle打包方式
  • C# UDP Server&Client

    千次阅读 2018-05-22 17:18:07
     /// 用于UDP发送的网络服务类  /// </summary>  private UdpClient udpcSend;  /// <summary>  /// 用于UDP接收的网络服务类  /// </summary>  private UdpClient udpcRecv;  /// <summary>  /// ...
    using System;
    
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;


    //本段代码中需要新增加的命名空间  
    using System.Net.Sockets;
    using System.Net;
    using System.Threading;  


    namespace UdpSocket
    {
        public partial class Form1 : Form
        {
            /// <summary>  
            /// 用于UDP发送的网络服务类  
            /// </summary>  
            private UdpClient udpcSend;
            /// <summary>  
            /// 用于UDP接收的网络服务类  
            /// </summary>  
            private UdpClient udpcRecv;


            /// <summary>  
            /// 按钮:发送数据  
            /// </summary>  
            /// <param name="sender"></param>  
            /// <param name="e"></param>  


            public Form1()
            {
                InitializeComponent();
            }






            private void button1_Click(object sender, EventArgs e)
            {
                if (string.IsNullOrWhiteSpace(txtSendMssg.Text))
                {
                    MessageBox.Show("请先输入待发送内容");
                    return;
                }


                // 匿名发送  
                //udpcSend = new UdpClient(0); //自动分配本地IPv4地址  
                // 实名发送  
                IPEndPoint localIpep = new IPEndPoint(IPAddress.Parse("192.168.2.112"), 12345); // 本机IP,指定的端口号  
                udpcSend = new UdpClient(localIpep);
                Thread thrSend = new Thread(SendMessage);
                thrSend.Start(txtSendMssg.Text);  
            }


            /// <summary>  
            /// 发送信息  
            /// </summary>  
            /// <param name="obj"></param>  
            private void SendMessage(object obj)
            {
                string message = (string)obj;
                byte[] sendbytes = Encoding.Unicode.GetBytes(message);
                IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse("192.168.2.112"), 8848); // 发送到的IP地址和端口号  
                udpcSend.Send(sendbytes, sendbytes.Length, remoteIpep);
                udpcSend.Close();
                ResetTextBox(txtSendMssg);
            }


            /// <summary>  
            /// 开关:在监听UDP报文阶段为true,否则为false  
            /// </summary>  
            bool IsUdpcRecvStart = false;
            /// <summary>  
            /// 线程:不断监听UDP报文  
            /// </summary>  
            Thread thrRecv;


            /// <summary>  
            /// 按钮:接收数据开关  
            /// </summary>  
            /// <param name="sender"></param>  
            /// <param name="e"></param>  
            private void button2_Click(object sender, EventArgs e)
            {
                if (!IsUdpcRecvStart) // 未监听的情况,开始监听  
                {
                    IPEndPoint localIpep = new IPEndPoint(IPAddress.Parse("192.168.2.112"), 8848); // 本机IP和监听端口号  
                    udpcRecv = new UdpClient(localIpep);
                    thrRecv = new Thread(ReceiveMessage);
                    thrRecv.Start();
                    IsUdpcRecvStart = true;
                    ShowMessage(txtRecvMssg, "UDP监听器已成功启动");
                }
                else // 正在监听的情况,终止监听  
                {
                    thrRecv.Abort(); // 必须先关闭这个线程,否则会异常  
                    udpcRecv.Close();
                    IsUdpcRecvStart = false;
                    ShowMessage(txtRecvMssg, "UDP监听器已成功关闭");
                }  
            }




            /// <summary>  
            /// 接收数据  
            /// </summary>  
            /// <param name="obj"></param>  
            private void ReceiveMessage(object obj)
            {
                IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Any, 0);
                while (true)
                {
                    try
                    {
                        byte[] bytRecv = udpcRecv.Receive(ref remoteIpep);
                        string message = Encoding.Unicode.GetString(bytRecv, 0, bytRecv.Length);
                        ShowMessage(txtRecvMssg, string.Format("{0}[{1}]", remoteIpep, message));
                        
                    }
                    catch (Exception ex)
                    {
                        ShowMessage(txtRecvMssg, ex.Message);
                        break;
                    }
                }
            }


            // 向RichTextBox中添加文本  
            delegate void ShowMessageDelegate(TextBox txtbox, string message);
            private void ShowMessage(TextBox txtbox, string message)
            {
                if (txtbox.InvokeRequired)
                {
                    ShowMessageDelegate showMessageDelegate = ShowMessage;
                    txtbox.Invoke(showMessageDelegate, new object[] { txtbox, message });
                }
                else
                {
                    txtbox.Text += message + "\r\n";
                }
            }


            // 清空指定RichTextBox中的文本  
            delegate void ResetTextBoxDelegate(TextBox txtbox);
            private void ResetTextBox(TextBox txtbox)
            {
                    txtbox.Text = "";
            }


            /// <summary>  
            /// 关闭程序,强制退出  
            /// </summary>  
            /// <param name="sender"></param>  
            /// <param name="e"></param>  
            private void Form1_FormClosing(object sender, FormClosingEventArgs e)
            {
                Environment.Exit(0);
            }


            private void OnClose(object sender, FormClosedEventArgs e)
            {
                //if (thrRecv != null)
                {
                    thrRecv.Abort(); //必须先关闭这个线程,否则会异常
                    udpcRecv.Close();
                    IsUdpcRecvStart = false;
                }
            }  
        }
    }
    展开全文
  • UdpServer.unitypackage

    2020-06-09 23:54:04
    Unity的UDP通信服务端样例,包含接收Udp数据功能,可以移植到自己的案例中使用,也可以使用配置文件动态修改I服务端P和端口号,简单易用。
  • udpserver和client例子代码

    千次阅读 2018-12-27 15:11:56
    udp_server.c #include &lt;stdio.h&gt; #include &lt;sys/types.h&gt; #include &lt;sys/socket.h&gt; #include &lt;netinet/in.h&gt; #include &lt;string.h&gt; #...

    写在这里,方便调试时使用参考,代码如有雷同,纯属巧合

    服务端

    udp_server.c

    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <string.h>
    #define BUF_SIZE 1024

    void handle_udp_msg(int fd)
    {
        char buf[BUF_SIZE];
        socklen_t len;
        int count, ret;
        struct sockaddr_in client_addr;


        struct timeval timeout;
        fd_set fds;
        #endif
        while(1)
        {
            FD_ZERO(&fds);
            FD_SET(fd, &fds);

            timeout.tv_sec = 60;
            timeout.tv_usec = 0;

            memset(buf, 0, BUF_SIZE);
            len = sizeof(client_addr);

            printf("select start......\n");

            ret = select(fd+1, &fds, NULL, NULL, &timeout);

            printf("select end..........ret=%d.\n", ret);
    #if 0
            if(ret == 0)
            {
                printf("select time out#######continue\n");
                continue;
            }

            if(ret == -1)
            {
                perror("select error");
                break;
            }
    #endif
            if(FD_ISSET(fd,&fds))
            count = recvfrom(fd, buf, BUF_SIZE, 0, (struct sockaddr*)&client_addr, &len);
            if(count == -1)
            {
                printf("recieve data fail!\n");
                return;
            }

            printf("recv client:%s\n", buf);

            sendto(fd, buf, BUF_SIZE, 0, (struct sockaddr*)&client_addr, len);
        }
    }

    int main(int argc, char* argv[])
    {
        int server_fd, ret;
        struct sockaddr_in ser_addr;

        if(argc != 2)
        {
            printf("Usage: %s <port> \n", argv[0]);
            return -1;
        }

        server_fd = socket(AF_INET, SOCK_DGRAM, 0);
        if(server_fd < 0)
        {
            printf("create socket fail!\n");
            return -1;
        }

        memset(&ser_addr, 0, sizeof(ser_addr));
        ser_addr.sin_family = AF_INET;
        ser_addr.sin_addr.s_addr = htonl(INADDR_ANY);
        ser_addr.sin_port = htons(atoi(argv[1]));

        ret = bind(server_fd, (struct sockaddr*)&ser_addr, sizeof(ser_addr));
        if(ret < 0)
        {
            printf("socket bind fail!\n");
            return -1;
        }

        handle_udp_msg(server_fd);

        close(server_fd);
        return 0;
    }

    客户端

    udp_client.c

    #include <stdio.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <string.h>

    #define BUF_SIZE 512

    void udp_msg_sender(int fd, struct sockaddr* dst)
    {
        socklen_t len;
        struct sockaddr_in src;
        char message[BUF_SIZE];
        while(1)
        {
            len = sizeof(*dst);
            fputs("Input message:(输入Q退出):", stdout);
            fgets(message, BUF_SIZE, stdin);
            if(!strcmp(message, "q\n") || !strcmp(message, "Q\n"))
                break;

            sendto(fd, message, BUF_SIZE, 0, dst, len);
            memset(message, 0, BUF_SIZE);
            recvfrom(fd, message, BUF_SIZE, 0, (struct sockaddr*)&src, &len);
            printf("recv server message:%s\n",message);
        }
    }

    int main(int argc, char* argv[])
    {
        int client_fd;
        struct sockaddr_in ser_addr;

        if(argc != 3)
        {
            printf("Usage: %s <IP> <port> \n", argv[0]);
            return -1;
        }

        client_fd = socket(AF_INET, SOCK_DGRAM, 0);
        if(client_fd < 0)
        {
            printf("create socket fail!\n");
            return -1;
        }

        memset(&ser_addr, 0, sizeof(ser_addr));
        ser_addr.sin_family = AF_INET;
        ser_addr.sin_addr.s_addr = inet_addr(argv[1]);
        ser_addr.sin_port = htons(atoi(argv[2]));

        udp_msg_sender(client_fd, (struct sockaddr*)&ser_addr);

        close(client_fd);

        return 0;
    }

    调用方法

    ./udp_server  port   // 启动服务

    ./udp_client   server_ip  port   //客户端访问服务端

    客户端输入,服务端接收反馈

     

    展开全文
  • Qt TCP UDP server client服务器客户端完整源代码代码
  • udp_echoserver DP83848网络服务函数库,配合教程完美实现数据的收发,测试平台STM32F407,其他同理
  • UDPServerUDPClient

    2014-09-02 15:21:54
    简单的UPDServerUDPClient
  • udpclient+udpserver

    2013-05-22 16:38:47
    参考了网上的许多资料,最终完成编译通过。随附件也一起带上编译完的文件。
  • 两个小工具用来debug tcp/udp 链接和测试tcp/udp server的压力 http://www.cnblogs.com/smark/p/4496660.html?utm_source=tuicool 和 sokit TCP/UDP 数据包收发测试
  • 模拟网络助手Demo(串口通讯、TcpServer、TcpClient、UdpServerUdpClient)
  • userver - udp server sample wserver - wsgi server sample wserver_ssl - wsgi ssl server sample gmysql - gevent mysql client & pool grpcserver - gevent rpcserver sample delay - gevent delay functions ...
  • 没用三方控件,只是udpserver的发送和接收。主要是16进制处理麻烦一点。注释写的很详细了,下载下来就可以直接用。
  • UDP工程可以在VS2010编译通过,亲测是可以使用的。机器环境是windows10 x64。不清楚的可以参考:https://blog.csdn.net/armwind/article/details/87564919
  • TCP和UDP的Client-Server交互流程

    千次阅读 2019-07-03 09:04:37
    2.UDP Client-Server交互流程 注:图片来源(https://www.cs.dartmouth.edu/~campbell/cs60/socketprogramming.html#x1-100013)。 3.一个形象的比喻 建立TCP连接就像是一个电话系统。 socket():你有了一部手机...
  • 客户端  1.创建客户端+端口  2.准备数据  3.打包(发送的地点及端口)  4.发送  5.... 1.... 2.... 3.... 4.... 5.... 6....package UdpDemo; import java.io.IOException; import java.net.DatagramP...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 205,503
精华内容 82,201
关键字:

serverudp