You are not logged in.
Pages: 1
I don't really know much java myself, but pretty much anyone here that does is likely
to first ask: Do you have any specific questions/problems? Your question now is
extremely vague and unclear... Are you just asking someone to supply you with code
for an existing chat app? (If so, how does that qualify as YOU writing it??) If that's
all you want, I suggest going to FreshMeat or SourceForge or some similar place,
and just searching for "java chat" or similar...
Offline
I don't really know much java myself, but pretty much anyone here that does is likely
to first ask: Do you have any specific questions/problems? Your question now is
extremely vague and unclear... Are you just asking someone to supply you with code
for an existing chat app? (If so, how does that qualify as YOU writing it??) If that's
all you want, I suggest going to FreshMeat or SourceForge or some similar place,
and just searching for "java chat" or similar...
THANK YOU :rolleyes:
Offline
hello while you said that they are easy to program ;could you PLZ help me to start my application. all documentation, or documentation or advice are welcome
The very simplest chat program I can imagine would be one that worked just over a LAN, using UDP broadcast packets. Each client would create a UDP socket, bind it to a well known port (pick any port number over 10000 or so to be safe), then select() on both that socket and on STDIN_FILENO. Whenever FD_ISSET(&readSet, STDIN_FILENO) is true, fgets() the string the local user typed in to stdin, and send() that string to your UDP broadcast socket, so that the string gets broadcast to all the other clients. Whenever FD_ISSET(&readSet, myUdpBroadcastSocket) is true, recv() the data from the UDP socket and puts() the data, so that the received data can be read by the user. That's it :^)
Offline
Considering he's using Java it's probably easier to make a multithreaded client. E.g. one thread for the GUI, and one (or more) for the network stuff.
Good point... I had forgot he was wanting Java. Although as I understand it the Java nio classes do have equivalents to select() and friends... I don't know if multiple threads make things harder or easier for this case, but in general they do make it harder to verify that the program is 100% correct.
Offline
Pages: 1