Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How do I use WSAStartup() in C# ??

How do I use WSAStartup() in C# ??

Scheduled Pinned Locked Moved C#
questioncsharphelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IrishSonic
    wrote on last edited by
    #1

    Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.

    R B 2 Replies Last reply
    0
    • I IrishSonic

      Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.

      R Offline
      R Offline
      Rein Hillmann
      wrote on last edited by
      #2

      Any reason why you're not using the System.Net.Socket class?

      1 Reply Last reply
      0
      • I IrishSonic

        Hiya I need to get WSAStartup in working C#. I have done this to get the function loaded in the project: #region SOCKETS [DllImport("wsock32.dll")] static extern int WSAStartup( uint wVersionRequested,LPWSADATA lpWSAData ); #endregion The problem is that I don't know the namespace that LPWSADATA uses. This anyone know what the namespace is for this structure?? Thanks.

        B Offline
        B Offline
        Burt Harris
        wrote on last edited by
        #3

        I don't think there is a public declaration of the WSADATA structure in any namespace Microsoft provides. Typically, writing in managed code, you don't need to call WSAStartup directly, using code in the System.Net.Sockets namespace will take care of calling it automatically for you. Is there some reason System.Net.Sockets isn't doing what you want? Burt Harris

        I 1 Reply Last reply
        0
        • B Burt Harris

          I don't think there is a public declaration of the WSADATA structure in any namespace Microsoft provides. Typically, writing in managed code, you don't need to call WSAStartup directly, using code in the System.Net.Sockets namespace will take care of calling it automatically for you. Is there some reason System.Net.Sockets isn't doing what you want? Burt Harris

          I Offline
          I Offline
          IrishSonic
          wrote on last edited by
          #4

          The simple reason is I am much more comfortable with using WSAStartup sockets. I am not to sure how to use C# sockets as I am only learning C# (not sockets) the last few weeks. My objective is display a list of network users and their IP Addresses. Thats all i want to do.. If somebody can plz show me how to do this in c#, I would be very grateful. Thanks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups