• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading & Writing to sockets

 
Ronan Gannon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
serge masse
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic