Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having problems with sockets

Status
Not open for further replies.

morpheos

Programmer
Dec 10, 2000
23
US
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.
 
hi morpheos!

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.

cya

frag
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top