socket flag
This commit is contained in:
22
SocketFlag/Client/Client.cs
Normal file
22
SocketFlag/Client/Client.cs
Normal 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();
|
||||
}
|
||||
}
|
10
SocketFlag/Client/Client.csproj
Normal file
10
SocketFlag/Client/Client.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user