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. socket problem

socket problem

Scheduled Pinned Locked Moved C#
sysadminhelpquestionjson
5 Posts 4 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.
  • S Offline
    S Offline
    snouto
    wrote on last edited by
    #1

    hi all. i want to know how can i get the ip address of the remote user connected to my server by knowing his network stream any help about that problem please ? Miss With The Best And Die Like The Rest

    F 1 Reply Last reply
    0
    • S snouto

      hi all. i want to know how can i get the ip address of the remote user connected to my server by knowing his network stream any help about that problem please ? Miss With The Best And Die Like The Rest

      F Offline
      F Offline
      felopater
      wrote on last edited by
      #2

      hiii, if you are using Socket class then after connection established all you have to do is: IPAddress addr=((IPEndPoint)socket.RemoteEndPoint).Address; marcoryos

      Z 1 Reply Last reply
      0
      • F felopater

        hiii, if you are using Socket class then after connection established all you have to do is: IPAddress addr=((IPEndPoint)socket.RemoteEndPoint).Address; marcoryos

        Z Offline
        Z Offline
        Zishan Haider
        wrote on last edited by
        #3

        and you can't if you're using TcpListener Regards

        L F 2 Replies Last reply
        0
        • Z Zishan Haider

          and you can't if you're using TcpListener Regards

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          Zishan Haider wrote: and you can't if you're using TcpListener Unless you inherit from TcpListener and use the protected Socket property. ;P xacc-ide 0.0.15 now with C#, MSIL, C, XML, ASP.NET, Nemerle, MyXaml and HLSL coloring - Screenshots

          1 Reply Last reply
          0
          • Z Zishan Haider

            and you can't if you're using TcpListener Regards

            F Offline
            F Offline
            felopater
            wrote on last edited by
            #5

            why not? TcpListener is server socket. after u start it Listener.Start(); you can accept connection from Socket socket=Listener.Accept(); and you can know from socket as i mentioned above who you are connecting with. marcoryos

            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