Thread: 2 questions about winsock 2

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    6

    2 questions about winsock 2

    hi, i have 2 questions about winsock2.

    VS's help says that winsock2 is not avaiblable for MFC. does that mean that if I make an mfc dll, i can't use winsock2? or do i just have to #include "Winsock2.h"? and if not, how would I make a dll that uses winsock in vs2008?

    the other question.. if I only have the socket's file descriptor (or "socket descriptor?") how would I get a SOCKET object from that (or a pointer/reference to its socket object)?

    ------

    btw, what i'm trying to do is make a dll that mimics Python's select.poll, using WSAPoll, so that I can then use the dll from Python using ctypes, since python doesn't come with select.poll support for windows..just in case anyone has any tips for that. thanks.
    Last edited by inhahe; 05-13-2008 at 07:05 AM.

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    You have to use MFC's CSocket() or CAsyncSocket() class.
    Last edited by abachler; 05-13-2008 at 09:19 AM.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    6

    WSAPoll?

    Quote Originally Posted by abachler View Post
    You have to use MFC's CSocket() or CAsyncSocket() class.
    thanks, but the problem is that I need to use WSAPoll specifically, and I think it's only available in Winsock2. and for .dll's in vs2008 I only saw two options, and they were both MFC. there *must* be a way to use winsock2 in a dll...!?

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. A very long list of questions... maybe to long...
    By Ravens'sWrath in forum C Programming
    Replies: 16
    Last Post: 05-16-2007, 05:36 AM
  3. WinSock questions.
    By p_tyo in forum C++ Programming
    Replies: 2
    Last Post: 01-15-2007, 12:20 AM
  4. winsock questions
    By hiya in forum Networking/Device Communication
    Replies: 29
    Last Post: 05-09-2005, 12:49 PM
  5. 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