Thread: best program to start

  1. #1
    Registered User
    Join Date
    Apr 2004

    best program to start

    i have read beejs guide to socket programming. after implementing some of the stuffs he mentioned what is the best "real" program that a starter like me can write. something to start off with. which one?
    even a fish would not have been in danger had it kept its mouth shut.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Are you asking for a small project idea?
    How about a chat client/server, or internet tic-tac-toe or other game.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Apr 2004
    could u just give me some small hints on both these programs. just the approach is enough.
    even a fish would not have been in danger had it kept its mouth shut.

  4. #4
    Registered User BillBoeBaggins's Avatar
    Join Date
    Oct 2003
    For the client Chat server it depends on how you want to tier it, but it basically comes down to two different application roles and/or settings.

    [Always Running]
    If you want an always running server, then you need to design an app that runs on a computer and accepts sockets connections.
    Then you will need a client app that will attempt to connect to the server app
    [Flow for Server Role]
    Server App Starts
    ...Application Loads
    ...App Creates Listening Socket
    ......App receives connection request from client
    .........App creates a new socket for the requesting client
    .........App (depending on you) creates profile based on client's IP
    .........App changes state of listening socket back to "Listen"
    ......App receives data from client socket
    .........Based on your code, server passes it to intended recipient, or handles it internally
    ...[End Loop]

    [Flow for Client Role]
    Client App Starts
    ...Application Loads
    ...User requests a connection to server
    ...App creates socket and attempts to connect to host app
    ......If connected
    .........App creates listening socket
    .........User sends messages to to host app
    .........User App awaits delivery confirmation and/or messages
    [End Loop]
    ......If failed to connect
    .........Repeat connection request process

    Kinda a broad sucky overview, and there might be a bit of logic error since it has been a while since I programmed using sockets.

    For the Tic-Tac-Toe game it is the same principle.
    The Client app will send data to the Host App (be it a full server app handling it or another client app playing the role of the host) and it will interpret it and display it (or not) accordingly on the alternate persons screen.
    It is actually a simple process, don't overcomplicate it.

    Safe Codin.

  5. #5
    Registered User
    Join Date
    Nov 2001
    Check out CodeProject code section for examples.

    Check out my website for more software development links.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to start program from subfolder
    By trancedeejay in forum C Programming
    Replies: 2
    Last Post: 04-01-2006, 03:39 PM
  2. Start program before login with WinXP
    By Icewind2003 in forum Tech Board
    Replies: 3
    Last Post: 02-12-2003, 04:50 PM
  3. Start up program
    By Breetai in forum Windows Programming
    Replies: 2
    Last Post: 01-11-2003, 01:12 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. Start a program
    By FunkeeMunkee in forum C++ Programming
    Replies: 1
    Last Post: 08-26-2001, 07:18 PM