Thread: CAsyncSocket samples...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    103

    CAsyncSocket samples...

    does anybody knows where i could find some MFC TCP CAsyncSocket client/server good examples ? i have searched everywhere and i can't find any good example everywhere i look i find different things

    thanks

  2. #2
    Registered User
    Join Date
    Dec 2004
    Posts
    73
    Try posting this in the network section and maybe you'll get some replies. Sorry I can't help you more, but I don't know much bout sockets. However, try www.gametutorials.com, they have some network tutorials i believe. Hopefully they have what you are looking for.

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    thx, maybe the moderators will move this thread there :P

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    MSDN: CAsyncSocket

    There are two example programs.

    gg

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Moved to network board
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    already knew it, its for .net :P i only use 6.0 and i kinda know how to make a server work just dunno about the client thanks anyway

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The MFC 6.0 CAsyncSocket is the same as the MFC 7.0 version. The CHATSRVR example has a cooresponding client application.

    There is plenty of MFC documentation on how it wraps socket functionality, so if you understand sockets then using the wrappers is just a matter of reading the documentation.

    gg

  8. #8
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    oh ok thx ill have a look at it

  9. #9
    Registered User
    Join Date
    Dec 2004
    Posts
    103
    hmm cant edit my last post anyway so i kinda understood how it works but how do you make the OnConnect, OnError... etc events work for this.. :
    Code:
    	CAsyncSocket sock;
    	sock.Create();
    	sock.Connect("yahoo.com",80);
    it connects and then it closes connection itself.. and i noticed it creates an UDP listening port then closes it anybody know why ?
    i hope you guys understand what im trying to say, sorry im just trying to learn how mfc/c++ works

    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WCF basic samples
    By George2 in forum C# Programming
    Replies: 7
    Last Post: 08-05-2008, 11:08 PM
  2. Problem with some arithmetic!
    By bobthebullet990 in forum C Programming
    Replies: 4
    Last Post: 01-05-2007, 10:04 AM
  3. MCI - multiple samples at once
    By tigs in forum Windows Programming
    Replies: 2
    Last Post: 06-16-2003, 01:55 PM
  4. Looking for samples how to write an IRC client in C#
    By gicio in forum C# Programming
    Replies: 1
    Last Post: 12-06-2002, 11:54 PM
  5. Winsock, CAsyncSocket Derivative.
    By Xei in forum C++ Programming
    Replies: 1
    Last Post: 06-03-2002, 11:24 PM