mirror of
https://github.com/inthehand/32feet.git
synced 2026-10-20 07:38:22 +08:00
21 lines
429 B
C#
21 lines
429 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace System.Net.Sockets
|
|
{
|
|
public static class SocketAddressExtensions
|
|
{
|
|
public static byte[] ToByteArray(this SocketAddress sa)
|
|
{
|
|
byte[] array = new byte[sa.Size];
|
|
for (int i = 0; i < sa.Size; i++)
|
|
{
|
|
array[i] = sa[i];
|
|
}
|
|
|
|
return array;
|
|
}
|
|
}
|
|
}
|