File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes how to work with socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply locked New topic
Author

how to work with socket

loveAnil Nayak
Greenhorn

Joined: Dec 29, 2009
Posts: 3
actually i have two GUI programs

1.Client1
2.Client2

Client1 will send data Client2 will receive and vice versa.


i have used socket but when the socket object is created by
Socket client = new Socket(InetAddress.getLocalHost(),1581);

Socket server = new Socket(InetAddress.getLocalHost(),1581);

what happened that on program is running and other get closed automatically because one socket is not shared by two program simultaniously

how to use the socket or any other class so that both side communication will be possible

and another problem is

if client1 program is sending data to client2 program with out interfering to that program client1 how to display data in GUI of client1(textarea)


so how to do both side communication both will send both will receive
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
Please do not post the same question multiple times: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to work with socket