MFC & CSocket
Results 1 to 5 of 5

Thread: MFC & CSocket

  1. #1
    Banned
    Join Date
    Sep 2002
    Posts
    33

    MFC & CSocket

    Could someone advise me if it is at all possible to create a client/server app to :

    1. Get it's own port
    2. Send udp datagrams and/or streams using the CSocketFile, CArchive combo

    Basically, I just need stable communication between the client and server. I'm almost posotive this would be possible but perhaps some WIN32 api functions wouldn't run if you were not logged in as an "admin". Any help would be greatly apprieciated.

    Sandman

  2. #2
    Senior Member
    Join Date
    Nov 2001
    Posts
    472
    Yeah, you're on the right track. I've made UDP connections with CSocket before. It's quick & easy. The CSocketFile & CArchive I've never used (I think) so you may not need them. Google around a bit and you'll find a tutorial or two.

    As for access to the api functions, I don't think that would be a problem. I've never heard that it's possible to permit a user from accessing ports. But of course the internet connection must have been configured already by the admin-user (or someone with admin rights).
    ---
    proactive

  3. #3
    Banned
    Join Date
    Sep 2002
    Posts
    33
    Exactly, that was the only problem that I would encounter. I just dont think that a function like "GetRegKey() or SetKey()" (or any registry or file manipulation), would be allowable at the "user" lever. But who know, thoughs microsoft guys are pretty stupid at times.

  4. #4
    Junior Member
    Join Date
    Nov 2002
    Posts
    2
    You only need user permissions to run socket client and servers - unless you were thinking of doing and RAW sockets and then you're gunna need Admin rights, but I think RAW socks can only be done with WinXP?

    If I were you I would steer clear of MFC and particularly CArchive/CSocketFile and basically call the APIs directly. Check out the following for one such common issue doing simple socket client server apps!

    <http://support.microsoft.com/default...;en-us;192704&>

    - R-Bola -

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Posts
    10
    I believe raw sockets are available in Win2K as well, but you have to be Administrator. IIRC, Raw sockets are enabled for any user in WinXP? *shudder* Horrible security hole...
    Byte Me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides