I figured something out that succeeded in making the hostname
constant, and it allows me to run the socket programs without error.
I'm posting what I did for future seekers. This is for mac os 10.4.7:
1) In System Preferences>Sharing, there is a name entered there:
Computer Name: John S
On May 24, 8:04 pm, 7stud <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm experimenting with a basic socket program(from a book), and both
> the client and server programs are on my computer. In both programs,
> I call socket.gethostname(), but I discovered that when I am connected
> to the internet, bo
7stud wrote:
[...]
>
> The strange thing is: the hostname and port in the output are not what
> I'm using in my server program:
> -
> import socket
>
> s = socket.socket()
>
> print "made changes 2"
>
> host = socket.gethostname() #I'm not connected to the internet when I
> use this li
>For local testing it is *much* easier to have your client
>and server use IP address 127.0.0.1
According to my book, an address is a tuple of the form (hostname,
port), so I didn't know what you meant by using 127.0.0.1 as the
address. I played around with it, and using the tuple ("127.0.0.1",
1
<[EMAIL PROTECTED]> wrote:
...
> > and I'm not connected to the internet and I run the program, I get:
> >
> > my-names-computer.local
> >
> > When I'm connected to the internet, I get:
> >
> > dialup-9.999.999.999.dial9.xxx.level9.net
>
> That would bug me to high hell. A router in the mi
En Fri, 25 May 2007 00:04:04 -0300, 7stud <[EMAIL PROTECTED]>
escribió:
> I'm experimenting with a basic socket program(from a book), and both
> the client and server programs are on my computer. In both programs,
> I call socket.gethostname(), but I discovered that when I am connected
> to th
On May 24, 8:50 pm, 7stud <[EMAIL PROTECTED]> wrote:
> Thanks for the response.
>
> On May 24, 9:24 pm, [EMAIL PROTECTED] wrote:
>
> > I can't imagine why your hostname would be changing, unless you
> > installed some of their proprietary software thats messing around with
> > things.
>
> When I
7stud wrote:
> Hi,
>
> I'm experimenting with a basic socket program(from a book), and both
> the client and server programs are on my computer. In both programs,
> I call socket.gethostname(), but I discovered that when I am connected
> to the internet, both the client and server hang and nothi
Thanks for the response.
On May 24, 9:24 pm, [EMAIL PROTECTED] wrote:
> I can't imagine why your hostname would be changing, unless you
> installed some of their proprietary software thats messing around with
> things.
When I first started using Terminal, I noticed that the prompt in
Terminal c
On May 24, 8:04 pm, 7stud <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm experimenting with a basic socket program(from a book), and both
> the client and server programs are on my computer. In both programs,
> I call socket.gethostname(), but I discovered that when I am connected
> to the internet, bo
10 matches
Mail list logo