본문 바로가기
반응형

C#61

[C#] NamedPipeServerStream, NamedPipeClientStream NamedPipeServerStream NamedPipeServerStream Class (System.IO.Pipes) Exposes a Stream around a named pipe, supporting both synchronous and asynchronous read and write operations. learn.microsoft.com namespace System.IO.Pipes { public sealed class NamedPipeServerStream : PipeStream { public const int MaxAllowedServerInstances = -1; public NamedPipeServerStream(string pipeName); public NamedPipeSer.. 2023. 12. 4.
[C#] PipeStream PipeStream 클래스 PipeStream 클래스 (System.IO.Pipes) 익명 파이프와 명명된 파이프를 모두 지원하는 파이프 주위의 Stream 개체를 노출합니다. learn.microsoft.com namespace System.IO.Pipes { public abstract class PipeStream : Stream { protected PipeStream(PipeDirection direction, int bufferSize); protected PipeStream(PipeDirection direction, PipeTransmissionMode transmissionMode, int outBufferSize); public override bool CanRead { get; } p.. 2023. 12. 1.
[C#] MemoryStream MemoryStream 클래스 MemoryStream Class (System.IO) Creates a stream whose backing store is memory. learn.microsoft.com namespace System.IO { public class MemoryStream : Stream { // 생성자 public MemoryStream(); public MemoryStream(int capacity); public MemoryStream(byte[] buffer); public MemoryStream(byte[] buffer, bool writable); public MemoryStream(byte[] buffer, int index, int count); public Memory.. 2023. 11. 24.
[C#] FileStream FileStream 클래스 FileStream Class (System.IO) Provides a Stream for a file, supporting both synchronous and asynchronous read and write operations. learn.microsoft.com namespace System.IO { public class FileStream : Stream { // 생성자 public FileStream(string path, FileMode mode); public FileStream(string path, FileMode mode, FileAccess access); public FileStream(string path, FileMode mode, FileAcces.. 2023. 11. 20.
[C#] Stream Stream 클래스 Stream 클래스 (System.IO) 바이트 시퀀스에 대한 일반 뷰를 제공합니다. 이 클래스는 추상 클래스입니다. learn.microsoft.com namespace System.IO { public abstract class Stream : MarshalByRefObject, IDisposable { protected Stream(); // 읽기 public abstract bool CanRead { get; } public abstract int Read(byte[] buffer, int offset, int count); public virtual int ReadByte(); public Task ReadAsync(byte[] buffer, int offset, int co.. 2023. 11. 17.
[C#] Task Task 클래스 Task 클래스 (System.Threading.Tasks) 비동기 작업을 나타냅니다. learn.microsoft.com - 스레드의 단점 * 스레드의 반환값을 얻기 힘듬. 어떤 형태로든 공유 필드를 만들어야 함 * 스레드의 예외를 잡아서 전파하기 힘듬 * 스레드의 연산이 끝난 후 다른 뭔가를 수행하게 만들 수 없음(Join은 현재 스레드가 차단됨) * 세밀한 동시성을 구현하는데 방해가 많음 - 조합 능력이 부족함 * 수많은 스레드를 사용할 경우 유지하는데만 많은 메모리가 소모됨 - Task * 스레드보다 더 높은 수준의 추상 * 하나의 동시적 연산(Concurrent Operation)을 대표 * 조합 할 수 있음(연속(Continuation) 기능을 이용해 여러 Task를 사슬처럼 .. 2023. 11. 6.
[C#] Thread Thread 클래스 Thread 클래스 (System.Threading) 스레드를 만들고 제어하며, 해당 속성을 설정하고, 상태를 가져옵니다. learn.microsoft.com 스래드 생성 - Thread 객체를 인스턴스화해서 Start 메서드 호출 - 인자: ThreadStart 대리자 하나, 스레드 시동 메서드 - 매개변수 없는 메서드를 가리켜야 함 public static void Main(string[] arg) { Thread t = new Thread(WriteY); t.Start(); for (int i = 0; i < 1000; i++) { Console.Write("x"); } } static void WriteY() { for (int i = 0; i < 1000; i++) { Con.. 2023. 11. 1.
[C#] Stopwatch Stopwatch 클래스 Stopwatch 클래스 (System.Diagnostics) 경과 시간을 정확하게 측정하는 데 사용할 수 있는 일련의 메서드와 속성을 제공합니다. learn.microsoft.com namespace System.Diagnostics { public class Stopwatch { public static readonly long Frequency; public static readonly bool IsHighResolution; public Stopwatch(); public bool IsRunning { get; } public TimeSpan Elapsed { get; } public long ElapsedMilliseconds { get; } public long Ela.. 2023. 10. 30.
[C#] PerformanceCounter, PerformanceCounterCategory PerformanceCounterCategory 클래스 PerformanceCounterCategory 클래스 (System.Diagnostics) 성능 카운터의 범주를 정의하는 성능 개체를 나타냅니다. learn.microsoft.com namespace System.Diagnostics { public sealed class PerformanceCounterCategory { public PerformanceCounterCategory(); public PerformanceCounterCategory(string categoryName); public PerformanceCounterCategory(string categoryName, string machineName); public string C.. 2023. 10. 28.
[C#] EventLog (Windows 이벤트 로그) EventLog 클래스 EventLog 클래스 (System.Diagnostics) Windows 이벤트 로그 조작을 제공합니다. learn.microsoft.com namespace System.Diagnostics { public class EventLog : Component, ISupportInitialize { public EventLog(); public EventLog(string logName); public EventLog(string logName, string machineName); public EventLog(string logName, string machineName, string source); public ISynchronizeInvoke SynchronizingObject.. 2023. 10. 26.
반응형