I want to realize Short Messaging Service under Web,it can send and receive message. I think there are two buffers,one is for send message,one for receive message. When I send message to send buffer,it can notify send buffer to deal this message.When one message arrive the receive message,it can notify me to deal also. I guess I should use Thread. Is there an example source code for me to download?
You took a wrong turn. You meant to go to Google, or Bing, or whatever your favorite search engine is. Type in "Java thread example" and be on your way.
What I find more interesting is you mentioning the word "web", which is highly confusing to me in this context. What do you mean by that?