Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

how to work with socket

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question multiple times: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
Just the other day, I was thinking ... about this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!