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. Web Development
  3. Linux, Apache, MySQL, PHP
  4. sockets and servers for game hosting

sockets and servers for game hosting

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
pythongame-devsysadminhostinghelp
5 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.
  • S Offline
    S Offline
    shahab96
    wrote on last edited by
    #1

    Hello again everybody. I'm making a network game at the request of a friend of mine and I've run into some trouble. the thing is, in the game-cafe all the computers are networked and i need to send data from one PC to the other. I came onto the solution of using sockets for this, but now I'm in a bit of a complex situation. I need to create the classes for the host computer and the client computer. the client asks for a game while the host listens for connections and accepts them. the problem's are:- 1) When i read the python docs it said that the function socket.bind(address) binds the socket to an address. Is that address on the socket's host or on the client PC? 2) While the socket is listening for connections using the socket.listen(backlog) function, how will it know which connection is from the client PC, so that it can accept that connection? 3) The stupid problem....how exactly do I check the entire network for hosts that are currently listening for connections? I would be REALLY thankful to anyone who can clear this up for me.

    M E 2 Replies Last reply
    0
    • S shahab96

      Hello again everybody. I'm making a network game at the request of a friend of mine and I've run into some trouble. the thing is, in the game-cafe all the computers are networked and i need to send data from one PC to the other. I came onto the solution of using sockets for this, but now I'm in a bit of a complex situation. I need to create the classes for the host computer and the client computer. the client asks for a game while the host listens for connections and accepts them. the problem's are:- 1) When i read the python docs it said that the function socket.bind(address) binds the socket to an address. Is that address on the socket's host or on the client PC? 2) While the socket is listening for connections using the socket.listen(backlog) function, how will it know which connection is from the client PC, so that it can accept that connection? 3) The stupid problem....how exactly do I check the entire network for hosts that are currently listening for connections? I would be REALLY thankful to anyone who can clear this up for me.

      M Offline
      M Offline
      Murlakatamus
      wrote on last edited by
      #2

      Hi, shahab96! It is a good question! Did you find out the solution?

      S 1 Reply Last reply
      0
      • M Murlakatamus

        Hi, shahab96! It is a good question! Did you find out the solution?

        S Offline
        S Offline
        shahab96
        wrote on last edited by
        #3

        not yet....it's kind of confusing.....

        1 Reply Last reply
        0
        • S shahab96

          Hello again everybody. I'm making a network game at the request of a friend of mine and I've run into some trouble. the thing is, in the game-cafe all the computers are networked and i need to send data from one PC to the other. I came onto the solution of using sockets for this, but now I'm in a bit of a complex situation. I need to create the classes for the host computer and the client computer. the client asks for a game while the host listens for connections and accepts them. the problem's are:- 1) When i read the python docs it said that the function socket.bind(address) binds the socket to an address. Is that address on the socket's host or on the client PC? 2) While the socket is listening for connections using the socket.listen(backlog) function, how will it know which connection is from the client PC, so that it can accept that connection? 3) The stupid problem....how exactly do I check the entire network for hosts that are currently listening for connections? I would be REALLY thankful to anyone who can clear this up for me.

          E Offline
          E Offline
          etkid84
          wrote on last edited by
          #4

          bind is for server to bind to a "well-known" port. listen is the next function that gets executed by the server after binding to the port. you should check out the Richard Stevens Network Programming books (vol 1) for a better explanation. although the information is explained using C, if you are a truly interested in learning; you will eventually learn it like a master. good luck,

          David

          S 1 Reply Last reply
          0
          • E etkid84

            bind is for server to bind to a "well-known" port. listen is the next function that gets executed by the server after binding to the port. you should check out the Richard Stevens Network Programming books (vol 1) for a better explanation. although the information is explained using C, if you are a truly interested in learning; you will eventually learn it like a master. good luck,

            David

            S Offline
            S Offline
            shahab96
            wrote on last edited by
            #5

            I actually lost hope on that topic. Well in the months since i posted it i learned how to use sockets in c and java so i think if the python sockets are explained in C i will be able to easily follow on. Even better if the code is actually based on C sockets. (Preferably linux sockets) Thanks David :)

            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