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. Role of ports in sockets

Role of ports in sockets

Scheduled Pinned Locked Moved C#
sysadmincsharpjson
3 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.
  • A Offline
    A Offline
    adhikarihemant
    wrote on last edited by
    #1

    Hi, I am working on a chatting project witch is to work using C# Sockets. There are two segments "Server" and "Client" as usual. I tried it on a local network and the result is with 5 systems in my lab, it is working nicely and on making a system Client and any one Server , we became able to have our conversations but with rest of two systems story is not same. When I am making my PC server and another one client , it is working but when I am keeping Client and making other one server it is not working and generating following exceptions: "A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond + C# socket program" If it is working with other PC of the LAB nicely than why it is not working with only 2 PCs. Structure is as : Server picks IP and port of the system on which it is running that is like : IP : 192.168.0.13 Port: 8000 On the Client PC We need to give IP of our Server and a port number, that is like IP : 192.168.0.13 Port : 8000 Can any one tell me why is this happening . Hemant S. Adhikari

    C P 2 Replies Last reply
    0
    • A adhikarihemant

      Hi, I am working on a chatting project witch is to work using C# Sockets. There are two segments "Server" and "Client" as usual. I tried it on a local network and the result is with 5 systems in my lab, it is working nicely and on making a system Client and any one Server , we became able to have our conversations but with rest of two systems story is not same. When I am making my PC server and another one client , it is working but when I am keeping Client and making other one server it is not working and generating following exceptions: "A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond + C# socket program" If it is working with other PC of the LAB nicely than why it is not working with only 2 PCs. Structure is as : Server picks IP and port of the system on which it is running that is like : IP : 192.168.0.13 Port: 8000 On the Client PC We need to give IP of our Server and a port number, that is like IP : 192.168.0.13 Port : 8000 Can any one tell me why is this happening . Hemant S. Adhikari

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Is there a firewall in place? Are the two PCs on the same network? The IP addresses given are on an internal range so if the connection crosses the internet it won't work, you need an external IP address.

      Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

      1 Reply Last reply
      0
      • A adhikarihemant

        Hi, I am working on a chatting project witch is to work using C# Sockets. There are two segments "Server" and "Client" as usual. I tried it on a local network and the result is with 5 systems in my lab, it is working nicely and on making a system Client and any one Server , we became able to have our conversations but with rest of two systems story is not same. When I am making my PC server and another one client , it is working but when I am keeping Client and making other one server it is not working and generating following exceptions: "A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond + C# socket program" If it is working with other PC of the LAB nicely than why it is not working with only 2 PCs. Structure is as : Server picks IP and port of the system on which it is running that is like : IP : 192.168.0.13 Port: 8000 On the Client PC We need to give IP of our Server and a port number, that is like IP : 192.168.0.13 Port : 8000 Can any one tell me why is this happening . Hemant S. Adhikari

        P Offline
        P Offline
        Pr teek B h
        wrote on last edited by
        #3

        Can you post the code that you have? If not, you can check out the code on this page (http://msdn.microsoft.com/en-us/library/w89fhyex.aspx). I would advise going through this page first. It provides good, working examples of client server sockets. Hope this helps :), Prateek

        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