Thread: Getting Started With Winsock!

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    22

    Getting Started With Winsock!

    Yeah!!! WinSock!!! Yeah!!! Ok. I want to dive more deeply into this and really aren't sure where to begin. Let me tell you what I want to do, and see if you can give me a few hints. I want to make a *simple* no wait, *very simple* chat program. I really don't know what all it will take but here what I think so far.

    1) Create a socket
    2) Bind the socket
    3) open the socket
    4) Send or receive data
    5) ??

    I don't want to fool around with servers or anything else, just have it so that you just punch in an IP address and a message and it'll send it to the other chat program at the specified IP address? If anyone can give me just a rough outline of what I need to do that would be great. Just an order to do what in would be great. The less detail the better actually cause I don't learn to much when someone write it all out for me :-) Thanks for the help.

    -Aaron
    I can't say for sure.....but that doesn't look work related.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    http://burks.bton.ac.uk/burks/pcinfo...ut/winsock.htm

    Here is a good tutorial that explains things in very simple terms.

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    There is a sample as part of MFC VC++ 6. CHATTER and CHATSRV I beleive. It is a sample showing tcpip socket communication. I would check it out. You can download it from msdn for free. It comes as a helpfile and then you get the source from within the help file.
    Best Regards,

    Bonkey

  4. #4
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    I highly recommend that you study from a book. I recommend Network Programming for Microsoft Windows Second Edition
    by Anthony Jones and Jim Ohmund.

    Kuphryn

  5. #5
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    yeah, I have tht book. Its cool...

  6. #6
    Registered User
    Join Date
    Sep 2001
    Posts
    22
    Ok. thanks for the tips. After MUCH reading and studing sample code I hammered out a rough dialog based app. However, when I tell the app to go into a loop to listen for some data my program is unresposive to other input. Am I missing something here?? There has to be a way to listen without locking up the whole program. Thanks for any tips.

    -Aaron
    I can't say for sure.....but that doesn't look work related.

  7. #7
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Look into Asynchronous sockets. These send a message to the window when there is something to be read. that way you don't "wait"
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Winsock issues
    By tjpanda in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2008, 08:32 AM
  2. Winsock Messaging Program
    By Morgul in forum Windows Programming
    Replies: 13
    Last Post: 04-25-2005, 04:00 PM
  3. Where do I initialize Winsock and catch messages for it?
    By Lithorien in forum Windows Programming
    Replies: 10
    Last Post: 12-30-2004, 12:11 PM
  4. weird winsock output and winsock 2 not working
    By whackaxe in forum Networking/Device Communication
    Replies: 4
    Last Post: 07-09-2004, 11:10 AM
  5. winsock
    By pode in forum Networking/Device Communication
    Replies: 2
    Last Post: 09-26-2003, 12:45 AM