Question: getting the Tomcat log file data by giving specific dates(from and to) and display it as a file in java.

Can anyone please guide me how to do this part asap.

Thanks in Adavance

Answer: 
You can close the socket. The peer can close the connection.
> 
> I thought only close() function could close the tcp connection.
> 
> 
> 

Why would that be? TCP is a software-defined protocol. The OS can implement it however it likes. All sensible OS'es clean up all resources that a terminated process was using. Sockets will be closed as well. What good would a TCP connection be if no process was using it and no process ever could (because the last handle was destroyed)? Makes no sense to keep the connection around if no one could ever read or write it.