Thread: Event Driven coding to C

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    2

    Event Driven coding to C

    This is going to be a rather odd post. I have programmed in Visual Basic for a long time, it is what I started in. I am now trying to move to c. I am getting the syntax down now but I am having a hard time getting my mind into the idea that things are not event driven, for instance, this code only gets executed when this happens, etc. I am trying to write an FTP client for fun and to broaden my C abilities, I can connect, send some data, receive some data, but I have NO idea how to deal with waiting for a packet, handling the packet, coming back, and listening for more data. In VB it would simply be a connection, and do whatever you need and when data comes in the Data_Arrival event of a winsock control would be called and the code in their would be executed. If someone could just take the time and explain exactly how I am supposed to handle different things such as a download\upload being handled along with listening for more data I would really appreciate it. Just a good explanation would be very helpful especially coming from someone who knows vb and c very well. Thanks a lot

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    6
    http://www.ecst.csuchico.edu/~beej/guide/net/

    I read this last night, very helpful

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    2
    Very good tutorial, Thank you. I see, I take advantage of the blocking from recv to know when more data comes, and then move on from there.. heh, can't wait until I get to deal with multiple sockets and forking

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to organize an event driven system
    By Marksman in forum C++ Programming
    Replies: 2
    Last Post: 02-04-2008, 06:11 PM
  2. RobotiX 08: Online Coding Event!
    By palkush in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 12-22-2007, 11:35 AM
  3. Event driven thread programming
    By jaxen in forum C++ Programming
    Replies: 6
    Last Post: 11-22-2006, 08:46 AM
  4. Event driven conditional??
    By theeld in forum C Programming
    Replies: 4
    Last Post: 10-10-2006, 12:33 PM