socket flag

This commit is contained in:
2023-02-06 15:51:08 +09:00
parent adf105be2d
commit 695c0ce1ac
7 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace Client;
internal class Client
{
static void Main(string[] args)
{
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Connect(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 20000));
byte[] buffer = new byte[1024];
//socket.Receive(buffer, SocketFlags.Peek);
socket.Send(Encoding.UTF8.GetBytes("normal"), SocketFlags.None);
socket.Send(Encoding.UTF8.GetBytes("OOB"), SocketFlags.OutOfBand); // tcp 헤더에 urgent mode 활성화 (긴급 메시지)
Console.ReadLine();
}
}