Hello guys i'm trying to send data to same socket at different times from different java classes. I can easily send the data from one class but after logging in when i try to send data to same socket from another java class ,there is an error. suggest me some solution

6 Years
Discussion Span
Last Post by 47pirates

One approach would be creating a class to handle networking and simply sharing that object between all your classes. That class would manage the sending and receiving of the messages. You would probably need to create a way for each object to ask the class if messages had arrived for it.

You'll probably want to thread the networked side of the application.

Edited by dmanw100: n/a


let me explain u guys. I had a login class from where i make a connetion to a socket through some port and then i have another class called CHATPANEL from where i want to send message to same socket and port from Login class without making any new connections. How can i do this any help will be appreciated :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.