I can make a socket works and what to do something relate to a chat Can I do that with sockets? and if can could you give an Idea or something do achieve it.
yes, you can make a chat server/client with sockets...
server = new ServerSocket(5000, 9999);
creates a ServerSocket that listens to port 5000.
client = new Socket( InetAddress.getByName( "127.0.0.1" ), 5000 );
creates a socket that connects to your local machine's port 5000.
i'm sure you can find info and documentation on Sockets and ServerSockets at java.sun.com. it should be under the java.net section of the documentation.
i'd go into further detail, but there's really to much to write here, i'd suggest looking at the examples and docs there.
if you still need help after that, i'll post some code that i used to create a chat app.
i have written a tiny chat-app with a server and a client...
i could send you this example but i don't have your mail-adress... however here is mine: real_firestorm@gmx.de
this chat-example is still some kind of buggy... but it works! if you are interested in it just notify me.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.