views:

43

answers:

3

Are there any tutorials on using sockets for client/server connection with Google App Engine for Java services?

+4  A: 
Ben S
any hacks around this restriction?
Blender
And what about java.net.DatagramSocketImplFactoryjava.net.HttpRetryExceptionjava.net.HttpURLConnectionjava.net.IDNjava.net.JarURLConnectionjava.net.MalformedURLExceptionjava.net.NetPermissionjava.net.NetworkInterfacejava.net.NoRouteToHostExceptionjava.net.PasswordAuthenticationjava.net.PortUnreachableExceptionjava.net.ProtocolExceptionjava.net.Proxy$Typejava.net.SocketExceptionjava.net.SocketImplFactoryjava.net.SocketOptionsjava.net.SocketPermissionjava.net.SocketTimeoutException
Blender
No. There's no other way to get the OS to give Java a network socket. The JVM simply doesn't allow it.
Ben S
Doesn't matter. You're running in their sandbox."[...] bytecode that attempts to open a socket or write to a file will throw a runtime exception.": http://code.google.com/appengine/docs/whatisgoogleappengine.html
Ben S
And what about JSP page can we open thrue tham?
Blender
That's still bytecode in the JVM, you'll just get an exception when processing the jsp.
Ben S
You can make outgoing HTTP requests, as well as sending and receiving email and XMPP messages - just not raw socket connections.
Nick Johnson
A: 

As it was said already, raw sockets are forbidden in GAE.

If you need client/server connectivity using GAE as a server and choice of medium is not critical, such connection can be arranged via web-services.

Vanya
A: 

Sockets are not allowed, but depending on what it is you are trying to do, you may find that the XMPP support is sufficient for your needs.

Russell Leggett