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 :)
shahab96
Posts
-
sockets and servers for game hosting -
sockets and servers for game hostingnot yet....it's kind of confusing.....
-
sockets and servers for game hostingHello 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.
-
python just for funoh...i never knew that. thanks for the update cjoki :D
-
python just for fun....ok....i guess this does make sense (except for pluto not being a planet.) I'll have to be a bit more careful next time. ;)
-
python just for fun:confused: wth? when did that happen?:confused:
-
python just for funI have no idea where i should post this, so whatever. here is a python program i made using vpython. I it must be downloaded before the program works. Also the program is made in python 3.1. It is a (very) innaccurate simulation of the milkyway.....mostly just created for the hell of it.
from visual import *
milkyway = frame()
sun_frame = frame(frame = milkyway)
mercury_frame= frame(frame = milkyway)
venus_frame= frame(frame = milkyway)
earth_frame= frame(frame = milkyway)
mars_frame= frame(frame = milkyway)
jupiter_frame= frame(frame = milkyway)
saturn_frame= frame(frame = milkyway)
uranus_frame= frame(frame = milkyway)
neptune_frame= frame(frame = milkyway)
pluto_frame= frame(frame = milkyway)sun = sphere(frame = sun_frame, pos = (0, 0, 0), radius = 10, color = color.yellow, material = materials.emissive)
mercury = sphere(frame = mercury_frame, pos = (15, 0, 0), radius = 0.5, color = color.red, material = materials.rough)
venus = sphere(frame = venus_frame, pos = (25, 0, 0), radius = 1, color = color.orange, material = materials.emissive)
earth = sphere(frame = earth_frame, pos = (33, 0, 0), radius = 2, material = materials.earth)
mars = sphere(frame = mars_frame, pos = (39, 0, 0), color = color.red, material = materials.rough)
jupiter = sphere(frame = jupiter_frame, pos = (50, 0, 0), radius = 3, color = color.orange, material = materials.emissive)
saturn = sphere(frame = saturn_frame, pos = (60, 0, 0), radius = 2.5, color = color.magenta, material = materials.rough)
saturns_rings = ring(frame = saturn.frame, pos = saturn.pos, axis = (-1, 1, 0), radius = 4)
uranus = sphere(frame = uranus_frame, pos = (75, 0, 0), radius = 2.15, color = color.cyan, material = materials.emissive)
neptune = sphere(frame = neptune_frame, pos = (83, 0, 0), radius = 1.75, color = color.blue, material = materials.rough)
pluto = sphere(frame = pluto_frame, pos = (90, 0, 0), color = color.blue, material = materials.emissive)view = input('Would you like a <S>ide-view or a <O>verhead view?\n')
if view == 'o' or view == 'O':
milkyway.rotate(angle = pi/4)
else:
passdef revolve_venus(venus):
venus.frame.rotate(angle = pi/6, axis = (0, 1, 0), origin = sun.pos)def revolve_mercury(mercury):
mercury.frame.rotate(angle = pi/5, axis = (0, 1, 0), origin = sun.pos)def revolve_earth(earth):
earth.frame.rotate(angle = pi/7, axis = (0, 1, 0), origin = sun.pos)def revolve_mars(mars):
mars.frame.rotate(angle = pi/8, axis = (0, 1, 0), origi