foo

Monday, June 20, 2005

Python: Simple Socket Test





I have found that there is not a lot of documentation out there that shows you a simple way to instantiate a socket connection. Here is a simple code snippet, that shows you how to make a connection using the socket module. This would be useful for checking whether a host is listening on a particular port. This is not a full sockets implementation(no send, or recieve), but simply tests if a TCP socket is open.


import socket

#Simply change the host and port values
host = '127.0.0.1'
port = '80'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((host, port))
s.shutdown(2)
print "Success connecting to "
print host + " on port: " + str(port)
except:
print "Cannot connect to "
print host + " on port: " + str(port)


FYI- You can test for a UDP port by changing "socket.SOCK_STREAM" to "socket.SOCK_DGRAM" .

Check out the documentation for the socket module here
.

Xbox360: Nvidia Will Make Games Work





It was just recently announced that MS has licensed Nvidia technology, so they can emulate Xbox games on the 360.
It sounds like any backwards compatibility will be through emulation.
The plan, is to use the Nvidia technology to emulate the original Xbox video card on the new ATI card in the 360. They will then ship the 360 with patches for the most popular games, pre-installed on the hard drive.
I don't know how this is really going to work. As a distribution model, it makes sense that they would release new patches over Xbox Live. But some research out there has indicated that only 10% of Xbox owners, use the Live option. This could really break the initial sales on this console to the general public. Although there will be a certain kind of person who will get it regardless(myself included), I think the perception that they have poor or minimal backwards compatibility will hurt sales to the average gamer.
Unless they can really leverage the new "Gold","Silver"... packages for Xbox Live, they may have some trouble getting game support out the door to the consumer. I hope it works, but I have my doubts.

Click Here for the article from gamesindustry.biz