aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes client not working perfectly.. please help. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "client not working perfectly.. please help." Watch "client not working perfectly.. please help." New topic
Author

client not working perfectly.. please help.

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

in a chat program , client is not working perfectly...
it sends and receives the first message . but after receiving the first message, other messages are not receiving from the server...
when a new instance of the client is created (i.e another user logged on) the first message from that user is sent to all clients.. again further messages are not sent to all clients... please help...


client side:




server side:





Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
Read this: Don't println to a Socket

Also, this is not a good idea for I/O code, since you won't know if there's a problem:
catch(Exception e) { }


Android appsImageJ pluginsJava web charts
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

sir, i cant understand that solution.. please give me in brief.. thank you.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
It's not a solution as such; the article describes the problem you're running into (or at least one of them - there may be more) and provides some strategies for avoiding it. Did you understand what it's talking about?
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

i think its about using println method with socket... but so many chat programs are written by using this method.. and they are working good too ... but what about this small program...? ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
What do you mean you "think" it's about something? Didn't you read it? The article makes it pretty clear under which circumstances that can be a problem; are you saying those circumstances don't apply to your situation?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

sanjeev charla wrote:and they are working good too ...

Until they port it to a different system, and everything breaks.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

the mistake is.... i didn't update the iterator.... it is solved... thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: client not working perfectly.. please help.
 
Similar Threads
Why is my connection reset on this test program?
Network assignment HELP NEEDED
getting a client to wait in run()
Two way chat?
Can Someone tell me what I am doing wrong??