winsock question

This is a discussion on winsock question within the C++ Programming forums, part of the General Programming Boards category; Hi Does anyone have any samples of a complete programming using either CSocket or the Winsock API. That part I'm ...

  1. #1
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455

    winsock question

    Hi
    Does anyone have any samples of a complete programming using either CSocket or the Winsock API. That part I'm having trouble is how to figure out when an event is fired, on OnReceive(), OnConnect() etc etc.

    Thanks

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Here is a tut that I liked, although the author's programming style wasn't very good they did a good job explaining.

    http://www.vijaymukhi.com/vmis/vmchap4.htm

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    In Winsock programming you have several I/O models to choose from including WSAAsyncSelect, overlapped I/O, and port-completion I/O.

    You should buy a good reference book on Winsock. One reason the fact that the implemention of robust I/O model such as overlapped I/O and port-completion I/O can be long and complicated.

    Kuphryn

  4. #4
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    Originally posted by master5001
    Here is a tut that I liked, although the author's programming style wasn't very good they did a good job explaining.

    http://www.vijaymukhi.com/vmis/vmchap4.htm
    yeah i read that like a year ago, i ahve it printed out and i refer to it alot

    kuphryn: do you have any suggestions on a book? that would be great, thanks man

  5. #5
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    I recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.

    Kuphryn

  6. #6
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Lightbulb

    I have one. I programmed a general TCP/IP client. It's kinda crude but it would do for experimental purposes. And I used mostly synchronous functions on it. I'll post it mext time get back here.
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  7. #7
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    alright, sounds good, thanks guys

  8. #8
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    Originally posted by kuphryn
    I recommend Network Programming for Microsoft Windows, Second Edition by Anthony Jones and Jim Ohmund.

    Kuphryn
    i saw your review on amazon, ill order it. thansk

  9. #9
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Cool!

    Kuphryn

  10. #10
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225
    Oh f%&k! I forgot my goddam floppy disk.
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  11. #11
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225
    Okay! Here it is.
    Attached Files Attached Files
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  12. #12
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    alright cool, thanks

    so whenever there is incoming data, int recv_data(char *data); will be called?

  13. #13
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225
    Yes that's right.

    When I programmed it, I'm assuming that the prog only receives data whenever it communicates with a server. It would be proper to call recv_data() after send_data() has been invoked. It's some sort of synchronous data transfer.
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. winsock
    By pode in forum Networking/Device Communication
    Replies: 2
    Last Post: 09-26-2003, 12:45 AM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 02:57 PM
  5. Determining Data Size For Network Send/Rec :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 6
    Last Post: 05-07-2002, 09:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21