Both ends of the socket communications are straight Java code. It is very simple.
On the GWT side, both halves, client and server, communicate via standard GWT communications mechanisms. The GWT server end and the foreign Java server it is communicating with occurs in Java over socket communication. Both are straight Java code. Hope that helps. Blake McBride On Mon, Apr 16, 2012 at 8:53 PM, Senyuan, Wang <[email protected]>wrote: > How the client deal with socket? > > On Apr 17, 3:46 am, Blake McBride <[email protected]> wrote: > > I thought I would give a little more information and a short example. > The > > server side handles multiple connections via threads. Communications > code > > on both side look the same. Here is a sample: > > > > s = new Socket((String) null, 2000); > > > > OutputStream out = s.getOutputStream(); > > > > InputStream in = s.getInputStream(); > > > > DataObjectMap outdom = new DataObjectMap(); > > > > outdom.put("name", "George"); > > > > outdom.put("age", 42); > > > > XML.send(outdom.toXML(), out); > > > > Document dom = XML.receive(in); > > > > DataObjectMap indom = new DataObjectMap(dom); > > > > String address = indom.getString("address"); > > > > Double pi = indom.getDouble("pi"); > > > > out.close(); > > > > in.close(); > > > > s.close(); > > > > Blake McBride > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" 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-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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-web-toolkit?hl=en.
