Commit ab01160e authored by Brickner_cp's avatar Brickner_cp

--no commit message

--no commit message
parent 4239204c
...@@ -170,7 +170,10 @@ PacketCommunicatorReceiveResult PacketCommunicator::GetSomePackets([Out] int% nu ...@@ -170,7 +170,10 @@ PacketCommunicatorReceiveResult PacketCommunicator::GetSomePackets([Out] int% nu
if (numPacketsGot == -1) if (numPacketsGot == -1)
throw BuildInvalidOperation("Failed reading from device"); throw BuildInvalidOperation("Failed reading from device");
if (numPacketsGot == -2) if (numPacketsGot == -2)
{
numPacketsGot = 0;
return PacketCommunicatorReceiveResult::BreakLoop; return PacketCommunicatorReceiveResult::BreakLoop;
}
return PacketCommunicatorReceiveResult::Ok; return PacketCommunicatorReceiveResult::Ok;
} }
...@@ -225,6 +228,11 @@ PacketCommunicatorReceiveResult PacketCommunicator::GetStatistics(int numStatist ...@@ -225,6 +228,11 @@ PacketCommunicatorReceiveResult PacketCommunicator::GetStatistics(int numStatist
return PacketCommunicatorReceiveResult::Ok; return PacketCommunicatorReceiveResult::Ok;
} }
void PacketCommunicator::Break()
{
pcap_breakloop(_pcapDescriptor);
}
void PacketCommunicator::SendPacket(Packet^ packet) void PacketCommunicator::SendPacket(Packet^ packet)
{ {
pin_ptr<Byte> unamangedPacketBytes; pin_ptr<Byte> unamangedPacketBytes;
......
...@@ -91,6 +91,8 @@ namespace PcapDotNet { namespace Core ...@@ -91,6 +91,8 @@ namespace PcapDotNet { namespace Core
PacketCommunicatorReceiveResult GetNextStatistics([System::Runtime::InteropServices::Out] PacketSampleStatistics^% statistics); PacketCommunicatorReceiveResult GetNextStatistics([System::Runtime::InteropServices::Out] PacketSampleStatistics^% statistics);
PacketCommunicatorReceiveResult GetStatistics(int numStatistics, HandleStatistics^ callBack); PacketCommunicatorReceiveResult GetStatistics(int numStatistics, HandleStatistics^ callBack);
void Break();
void SendPacket(Packets::Packet^ packet); void SendPacket(Packets::Packet^ packet);
void Transmit(PacketSendQueue^ sendQueue, bool isSync); void Transmit(PacketSendQueue^ sendQueue, bool isSync);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment