Click here to Skip to main content
15,503,808 members
Home / Discussions / C#
   

C#

 
QuestionCatching exceptions on backgroundworker Pin
pjank4215-Aug-14 20:44
pjank4215-Aug-14 20:44 
QuestionRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan15-Aug-14 22:25
mveRichard MacCutchan15-Aug-14 22:25 
AnswerRe: Catching exceptions on backgroundworker Pin
pjank4216-Aug-14 2:50
pjank4216-Aug-14 2:50 
GeneralRe: Catching exceptions on backgroundworker Pin
Richard MacCutchan16-Aug-14 6:10
mveRichard MacCutchan16-Aug-14 6:10 
AnswerRe: Catching exceptions on backgroundworker Pin
Eddy Vluggen16-Aug-14 3:10
professionalEddy Vluggen16-Aug-14 3:10 
AnswerRe: Catching exceptions on backgroundworker Pin
jschell17-Aug-14 10:56
jschell17-Aug-14 10:56 
GeneralRe: Catching exceptions on backgroundworker Pin
pjank4218-Aug-14 9:40
pjank4218-Aug-14 9:40 
QuestionMissing TCP Packets Pin
M Riaz Bashir15-Aug-14 20:24
M Riaz Bashir15-Aug-14 20:24 
Hi,
Kindly note that, while capturing network incoming tcp packets using following codes/methods, missing some packets. It is sure that all packets all coming on my network perfectly fine but unfortunately I am missing some packets. Please let me know, what and where, I am doing mistake in my following mentioned codes.

Thank you & Regards
(Riaz)


C#
public void Capture()
{
    _mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
    _mainSocket.Bind(new IPEndPoint(IPAddress.Parse("192.168.1.10"), 0));

    var byTrue = new byte[] { 1, 0, 0, 0 };
    var byOut = new byte[] { 1, 0, 0, 0 };

    _mainSocket.IOControl(IOControlCode.ReceiveAll, byTrue, byOut);

    _mainSocket.EnableBroadcast = true;
    _mainSocket.BeginReceive(_data, 0, _data.Length, SocketFlags.None, OnReceive, null);
}

private void Parse(byte[] data, int size)
{
    ipH = new IPHeader(data, size);
    if (ipH.ProtocolType == Protocol.TCP)
    {
        FilterData(data, size);
    }
    System.Threading.Thread.Sleep(5);
}

private void FilterData(byte[] data, int size)
{
      // Here i am inserting & updating packets data into my database
}

AnswerRe: Missing TCP Packets Pin
Dave Kreskowiak16-Aug-14 5:29
mveDave Kreskowiak16-Aug-14 5:29 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 20:54
M Riaz Bashir16-Aug-14 20:54 
AnswerRe: Missing TCP Packets Pin
Rob Philpott16-Aug-14 7:34
Rob Philpott16-Aug-14 7:34 
GeneralRe: Missing TCP Packets Pin
M Riaz Bashir16-Aug-14 20:54
M Riaz Bashir16-Aug-14 20:54 
QuestionThread Freeze when trying Abort Pin
Member 1098515215-Aug-14 13:17
Member 1098515215-Aug-14 13:17 
GeneralRe: Thread Freeze when trying Abort Pin
PIEBALDconsult15-Aug-14 13:47
professionalPIEBALDconsult15-Aug-14 13:47 
QuestionSummary Report in GridView Pin
sk_ko14-Aug-14 23:02
sk_ko14-Aug-14 23:02 
AnswerRe: Summary Report in GridView Pin
Chris Quinn14-Aug-14 23:36
Chris Quinn14-Aug-14 23:36 
AnswerRe: Summary Report in GridView Pin
Mycroft Holmes15-Aug-14 0:00
professionalMycroft Holmes15-Aug-14 0:00 
GeneralScope of Share point and Silverlight Pin
Member 1059394814-Aug-14 4:40
Member 1059394814-Aug-14 4:40 
GeneralRe: Scope of Share point and Silverlight Pin
Richard MacCutchan14-Aug-14 5:22
mveRichard MacCutchan14-Aug-14 5:22 
Questionhow do i make each combo box to show a dropdown of the value of the Quantity it has fetched. Pin
Member 1050484913-Aug-14 10:02
Member 1050484913-Aug-14 10:02 
SuggestionRe: how do i make each combo box to show a dropdown of the value of the Quantity it has fetched. Pin
ZurdoDev13-Aug-14 10:24
professionalZurdoDev13-Aug-14 10:24 
QuestionHow to increment div count in path Pin
Member 1098388513-Aug-14 7:09
Member 1098388513-Aug-14 7:09 
Questionc# Play Video Fullscreen Pin
Member 416962813-Aug-14 6:20
Member 416962813-Aug-14 6:20 
AnswerRe: c# Play Video Fullscreen Pin
Simon_Whale13-Aug-14 6:41
professionalSimon_Whale13-Aug-14 6:41 
GeneralRe: c# Play Video Fullscreen Pin
Member 416962813-Aug-14 6:53
Member 416962813-Aug-14 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.