23 lines
538 B
C#
23 lines
538 B
C#
using System;
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
using Inspectron.HawkEye.RTSP;
|
|
|
|
namespace Inspectron.HawkEye.Protocol
|
|
{
|
|
public static class SocketExtensions
|
|
{
|
|
public static void Listen(this Socket self,IPAddress adapterAddress,int port)
|
|
{
|
|
self.Bind(new IPEndPoint(adapterAddress,port));
|
|
}
|
|
|
|
public static void SendData(this Socket self, byte[] data)
|
|
{
|
|
Console.WriteLine("send data");
|
|
|
|
|
|
self.Send(data);
|
|
}
|
|
}
|
|
} |