User Profile

Collapse

Profile Sidebar

Collapse
learner247
learner247
Last Activity: Jan 13 '12, 10:16 AM
Joined: Oct 26 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • learner247
    replied to LINQ to SQL one to many query
    in .NET
    SOLVED!

    Code:
    BiosClassesDataContext dc = new BiosClassesDataContext();
    
    DateTime now = new DateTime(2011, 2, 18, 17, 0, 0, 0);
    DateTime tommorow = now.Date.AddDays(1);
    
    DataLoadOptions options = new DataLoadOptions();
    options.AssociateWith<movie>(f => f.shows.Where(
    	s =>
    	s.start_datetime > now &&
    	s.start_datetime < tommorow
    ).OrderBy(
    	s => s.start_datetime
    ...
    See more | Go to post

    Leave a comment:


  • learner247
    started a topic LINQ to SQL one to many query
    in .NET

    LINQ to SQL one to many query

    Hello,

    I have question about LINQ.
    My scenario:

    There is a database with a movie table and a shows table:

    movie
    number [PK]
    name

    show
    show_number [PK]
    movie_number [FK]
    start_datetime

    Now I only want to retrieve those movies that still have unstarted shows on the current day.
    I dont know how to filter the movies based on the shows.
    ...
    See more | Go to post

  • clientSocket_Re ceivedData is a handler of the ReceivedData event.
    ReceivedData is fired by the socket wrapper class when the background worker reportsprogress . (see code a few posts back).

    the code is not different than yours.

    Code:
    private bool isBuzzy = false;
    
    private void clientSocket_ReceivedData(object sender, ReceivedDataEventArgs e)
    {
    	if( ! this.isBuzzy)
    	{
    		this.isBuzzy
    ...
    See more | Go to post

    Leave a comment:


  • I knew you ment this, but this is not happening in my program. A queue is like a waiting line, the all WAIT. So when one event is handled the next one is happy: it is his turn to be processed.

    I tested it with a else block to see if the boolean was allready true when the handler started execution, tried both a messagebox and System.Diagnost ics.Debug.Write Line( );
    So the bool is allways false when the event starts and return...
    See more | Go to post

    Leave a comment:


  • if all the events are waiting to be handled in one long queue then it does not matter if i keep track of some boolean right? when the event is done it will be false, so when the next one starts it is also false.

    and even if some events are skipped, blocked, or ignored the massive number of events will still ensure that the form class is constantly buzzy so it wont have time to do other gui things like dragging the form around the ...
    See more | Go to post

    Leave a comment:


  • For anyone who wants to know this is how i solved the problem:

    This code must sit at the socket level not at the event handling level, because the events are triggered at an insane rate and in one second tens of thousands events are triggered. All those events will be queued and the form will try to handle them. In this way i stop the events from triggering.

    Code:
    private bool canHandleBuffer()
    {
    	if ( ! this.bufferLimitIsSet)
    ...
    See more | Go to post

    Leave a comment:


  • Sorry guys need to go,
    I really appreciate you guys help!
    back in a few hours
    See more | Go to post

    Leave a comment:


  • This emmediately gave me a stackOverflow exception
    See more | Go to post

    Leave a comment:


  • Thanks for your reply

    The listbox is indeed way faster, probably bacause it uses a datastructure for the items instead of a single string.

    But the form still freezes, it is overwhelmed by the events triggered by the socket.

    What comes to my mind is some timer to check each second how much buffers have been received since the last second. if it exceeds a limit then close the connection.
    See more | Go to post

    Leave a comment:


  • Thanks for your response,

    I have thought about reuse :)
    What you say I have allready done, i made a class that fires my own events: (ConnectionFail ed, ConnectionSucce eded, ReceivedData, StoppedReceivin g, etc)
    Sorry for not mentioning that

    code to react to "ReceivedDa ta" event: (in the form)
    Code:
    private void clientSocket_ReceivedData(object sender, ReceivedDataEventArgs e)
    {
    	string
    ...
    See more | Go to post

    Leave a comment:


  • learner247
    started a topic How to protect socket against dos attack

    How to protect socket against dos attack

    Hi,

    I am learning csharp and have a question:

    My question is about handling a receiving socket.
    I use the backgroundworke r class for multithreading.

    In the doWork event there is a while loop that uses the blocking receive method.
    Once bytes are received they are passed to the reportProgress method.

    The ProgressChanged event handler will convert the bytes to a string and will use this...
    See more | Go to post
    Last edited by learner247; Oct 26 '09, 03:10 PM. Reason: typo
No activity results to display
Show More
Working...