• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading & Writing to sockets

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I hope someone can help me,
What is the best way to open a socket connection with a server when you need to be able to send and recieve data based on commands from the commandAction method.
I have serval menus and forms and I want to be able to maintain the connection even as I link from one to the other so that I can send and recieve data.
(e.g. In a list, the user selects an option. A commandlistner is used to monitor for any action performed. In the commandAction method, I want to be able to send a specified command(String) to the server and then read the response)
I'v tried setting up the connection using Runnable, but I can't read or write to the socket from the commandAction.
Any help would be great
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ronan,
you can use or copy code from packages org.leafy.j2 and org.leafy.j2me in http://leafy.dev.java.net/ in the File sharing section.
First download file leafyseadragon_0_4_all.zip from the v.0.7.5 directory.
it probably does what you want.
[ January 24, 2004: Message edited by: serge masse ]
[ January 24, 2004: Message edited by: serge masse ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic