Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

persistent connection in old jdk 1.1.8?

My idea is to have one server made in phyton and one client made in java.
is there any persistent connection code examples for the jdk 1.1.8?
That would be very cool!

so my main goal is when the client is connected.the client can post data whenever and the server can post data whenever.
0
thor918
Asked:
thor918
  • 4
1 Solution
 
bloodredsunCommented:
While not classically keep-alive, you could use URL connections ( java.net.URLConnection ) which have been around since JDK 1.0, else you can use sockets (java.net.Socket) and create your own connection.
0
 
thor918Author Commented:
good.I have been looking for some examples on socketserver,that works in jdk 1.1.8
I found one that seems to work. but that closes the socket once the data has been sent.I want to hold the connection open.
Examples wanted :)
0
 
thor918Author Commented:
http://zerioh.tripod.com/programming/sockets.html
works for me.but it don't work if I use the clientclass in another class.but I get

<identifier> expected

      client.run();

I use this in the other class
      Requester client = new Requester();
      client.run();

changes :
main method is removed
public class is class
run method is made public

anyone with some bright idea?
it compiles ok if I remove
client.run();
I just don't understand why it dosent work!
0
 
thor918Author Commented:
never mind that error.it was a newbie mistake
0
 
thor918Author Commented:
sorted out problems.sockets works greate :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now