資源簡(jiǎn)介
C#Socket UDP 通信源碼
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Net;
using?System.Net.Sockets;
using?System.Text;
namespace?AUDSTest
{
????public?class?Program
????{
????????
????????static?void?Main(string[]?args)
????????{
????????????int?recv;
????????????byte[]?data?=?new?byte[1024];
????????????uint?IOC_IN?=?0x80000000;
????????????uint?IOC_VENDOR?=?0x18000000;
????????????uint?SIO_UDP_CONNRESET?=?IOC_IN?|?IOC_VENDOR?|?12;
????????????byte[]?optionInValue?=?new?byte[]?{?Convert.ToByte(false)?};
????????????byte[]?optionOutValue?=?new?byte[4];
????????????//得到本機(jī)IP,設(shè)置TCP端口號(hào)?????????
????????????IPEndPoint?ip?=?new?IPEndPoint(IPAddress.Parse(“127.0.0.1“)?6789);
????????????IPEndPoint?mubiaoip?=?new?IPEndPoint(IPAddress.Parse(“127.0.0.1“)?2021
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3172??2017-06-23?14:13??Program.cs
-----------?---------??----------?-----??----
?????????????????3172????????????????????1
評(píng)論
共有 條評(píng)論