• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Pls anyone answer this, its urgent

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can any one resolve this?

I have few clients, Lets say ClientA, ClientB and ClientC and a ServerSocket program(port opened ex ort no.4545)

My Question is

ClientA has to send message to server but it should not receive any response from server

ClientB has to send message to server but it should not receive any response from server

Here,

ClientC has to receive message from server, whatever server sends;

so there are 2 clients have to send message to server and reply has to be received by 3rd client(ClientC).

So server has to do the following job

1. receive messages from 2 clients and response should go to 3rd client

ClientA program has written in Oracle

ClientB program has written in Oracle

ClientC program has written in Java (Socket)

ServerSocket program has written in Java (no need to mention)


 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't ask the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
While you are waiting for an answer, you may want to read our FAQ, How To Ask Questions On JavaRanch, in particular, the entries EaseUp and Patience Is A Virtue.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the server tell the clients apart? Maybe C could connect to the server first with a request that says "SUBSCRIBE", something like ...

I'd be tempted to say C is not a client at all, but another server. Then we'd remove the "subscribe" message from the logic, and connect to C every time we want to send a message:

You wouldn't really need to connect to C inside the loop, but that would handle any broken connections, perhaps if C had to stop and restart.
 
sankar singh
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stan James:
How does the server tell the clients apart? Maybe C could connect to the server first with a request that says "SUBSCRIBE", something like ...

I'd be tempted to say C is not a client at all, but another server. Then we'd remove the "subscribe" message from the logic, and connect to C every time we want to send a message:

You wouldn't really need to connect to C inside the loop, but that would handle any broken connections, perhaps if C had to stop and restart.




Dear Stan James,
I am happy to see your reply, thanks a lot. my problem is " 'N' number of clients can connect from Oralce(client program) to send message to server(ServerSocket, port 4747). But only my client(java program) has to connect server port and read message from that port. Rest of all clients have to send message to the port 4747.
Can you pls give some tips to resolve this?
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic