[Tutor] socket programming

ccl chrislubrecht@home.com
Fri, 18 Jan 2002 23:03:39 -0500


I must be missing something, or am just not getting something.

If I do...

while 1:
   a = socketthing.recv(1024)
   socketthing.send("Spam! =>"+a)



It sends back whatever is typed...

If I do...

While 1:
  a = socketthing.recv(1024)
  if a == "Dead Parrot":
    sockettthing.send("It's Dead")
  else:
     socketthing.send("Silly")


I get nothing on sending "It's dead"..but then I hit enter again and I get 
"Silly"

I've double checked the rest. if I change in the echo part, it works 
ok..which tells me I'm doing the sockets right...what am I doing wrong with 
the rest?


Thanks!

Chris