반응형 Asynchronous2 C# 소켓 억셉트 Socket Asynchronous Accept 초간단 소스 using System; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; namespace Network_Async_Test { class Program { static void Main(string[] args) { Socket aSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); aSocket.Bind(new IPEndPoint(0, 5000)); aSocket.Listen(5); aSocket.BeginAccept(new AsyncCallback(Jue_Listen), aSocket); whi.. 2021. 9. 15. C# Console 비동기 입력 ReadLine ReadKey Asynchronous input 초간단 소스 using System; using System.Threading; using System.Threading.Tasks; namespace Async_console_test { class Program { static void TempAction() { string Temp = Console.ReadLine(); Console.WriteLine("입력함 : [{0}]", Temp); Task.Factory.StartNew(TempAction); } static void Main(string[] args) { Task.Factory.StartNew(TempAction); while (true) { Console.Write("."); Thread.Sleep(500); } } } } Tested By VS20.. 2021. 9. 15. 이전 1 다음 728x90 반응형