About TCP Connection Persistentance

Hi everyone

Nowadays, I am developing a server program which communicate with mobile client on CDMA network

So, the client acts like DHCP client which means its ip address is dynamically set at any time

It was no problem just client send its request then server response the data wanted

but I have met some trouble because

server have to send request message to client

There are several further condition here

first client sends login message and socket session

second server have to cache the information from client ( ip, port, login information, socket TCP session)

third there is some other client (not mobile client) request information about mobile client then, server request moblie client on cached TCP session

last is optional but I want to use NIO Socket...

I am entirely new to this topic

I can not handle with this problem.......

my problem is

I don't have any kownledge about caching TCP Session

Also, I don't know how to find a proper mobile client at the time when the other client request information for mobile client cached client TCP Session

If there is anyone who have experience with this problem

I may ask the solution how to achive my goal

or some mechanism for that

thanks for reading.....

[1345 byte] By [tommybeea] at [2007-10-3 4:53:18]
# 1
You just have to save the socket or socket channel that was accepted for each client. That represents the TCP session.
ejpa at 2007-7-14 22:58:09 > top of Java-index,Archived Forums,Socket Programming...
# 2

I need the reference for that solution because server must know which connection between server and client is dead or not preparing the sever send a request for specific mobile client at any given time

I have been thinking several method for accomplish that task

so, I finally decide client and server must exchange ping message each other every moment which is determined by me according to time scheduling

most of all, server shouldn't close client connection util the client wants to close its connection

I am not so sure how many client wants to connect the server keeping the socket session to communicate ping message

100? 200? or whatever.....

so If there exist references sites, book, or whatever you know about that

please let me know about that

Any materials can be Okay to me......

I am looking forward to reply your message

thanks

Message was edited by:

tommybee

tommybeea at 2007-7-14 22:58:09 > top of Java-index,Archived Forums,Socket Programming...
# 3
http://www.telekinesis.com.au/wipv3_6/FundamentalNetworkingInJava.A21
ejpa at 2007-7-14 22:58:09 > top of Java-index,Archived Forums,Socket Programming...