NetWorkServer.cs using UnityEngine; using System.Collections; public class NetWorkServer : MonoBehaviour { // Use this for initialization // 定义远程连接IP地址 private string remoteIP = "127.0.0.1"; // 定义远程的端口号 ; // 定义本地侦听的端口号 ; // 限制连接数量为15个用户 ; // 是否启
Socket using System; using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Text; namespace Socket服务端 { class Program { static void Main(string[] args) { //1.创建一个Socket对象 Socket tcpServer = new Socket(AddressFamily