You cannot use sockets on app engine.

On Nov 5, 2:26 am, Felix <[email protected]> wrote:
> Hi,
>    This is my first question in the forum :)
>    I am trying to insert a data but it is not working. I verified the
> code locally and it works in the localhost but it does not actually
> works in the domain. I have pasted the code .Can someone please
> correct me, if im doing something incorrectly.
>
> import socket
> import sys
> from google.appengine.ext import db
>
> host = "localhost"
> port = 8082
> size = 1024
> serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> serverSocket.bind((host,port))
> serverSocket.listen(backlog)
>
> class UserData(db.Model):
>         email = db.EmailProperty(required=True)
>         city = db.StringProperty(required=True)
>         state = db.StringProperty(required=True)
>
> while 1:
>         client, address = serverSocket.accept()
>         userObject = UserData
> (email="[email protected]",city="chennai",state="TN")
>         db.put(userObject)
>         client.close()
>
> Yes, it is an infinite loop. Just for the testing purposes.
> After this, when I try to see the data viewer in the domain, it says
> no results for the query
> Select * from UserData
>
> But for the same code, when i queried in the localhost, it returned
> data in the interactive data viewer...
>
> Thanks,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to