views:

41

answers:

1

I'm working on some software that consists of a server and clients on one machine that communicate via local sockets.

The server (written in Java) opens a java.net.ServerSocket on port 9000, and the clients (in either Java or Python) have to connect to localhost:9000 to communicate.

In Windows and Linux, this works fine. On Mac OS X (10.6, Java 1.6.0), no communication between the server and client occurs even though I don't get any errors. Is there something I need to code differently for Mac or is there a system setting I need to change to make it work?

Python client snippet:

import socket
from re import sub

def main(server_address, port):
    '''
    Connect to the server.
    '''

    rclf = '\r\n'
    s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    s.connect((server_address,port))
    s.send("Version:1.0.0"+rclf)
A: 

Is this the complete code sample? The main method isn't called anywhere in here.

McJeff
It's just a snippet of what's in the program, and this question should be a comment, not an answer.
erjiang