• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pls anyone answer this, its urgent

 
sankar singh
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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)


 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic