Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: Dynamically creating multiple instances for unicast
Topic Summary: Unicast to an instance
Created On: 20-Oct-2006 20:31
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Ramandeep Ahuja, on Thursday, November 2, 2006 6:16 PM

Answer:
Thanks Ian, this is the method I have been using! Best Raman
 20-Oct-2006 20:31
User is offline View Users Profile Print this message


Ramandeep Ahuja

Posts: 10
Joined: 25-Sep-2006

Hello,

I have two classes first lets say is the "server" and the second "client". How do I model N clients connected to the server since in the model I have only defined one port between server and client (although the mutliplicity of the client is *).

I have the following

--------------------------------
System contains Server and Client. Assume 1:1 multiplicty for the connector C

                            [Server]  [port_Server_Client]-------C----------[port_Client_Server] [Client1 ]
                [port_Server_Client]   \  
                                                \
                                                C 
                                                  \
                                              [port_Client_Server] [Client2]
I created two instances of Client using: (Note System contains MyClients as a composite attribute)  
In the System state machine :

Client client1, client2;

MyClients.append( new Client() );
client1 = offspring;
MyClients.append( new Client() );
client2 = offspring;

How  can  the Server class learn which client is reachable through which port on the server ? How do I send a signal to only Client1 ?



Thanks in advance
Raman



-------------------------
Raman

Edited: 20-Oct-2006 at 21:57 by Ramandeep Ahuja
Report this to a Moderator Report this to a Moderator
 2-Nov-2006 11:23
User is offline View Users Profile Print this message


Ian Barnard

Posts: 91
Joined: 4-Jul-2002

Raman

Both clients are using the same port, so the port can't be used to direct communication to a particular client.

There are some options:

1. The Server sends the signal to a specific object (client) by e.g.:
MyClients[1].sigToClient() or client1.sigToClient() in an output symbol

2. After a signal has been received by the server from a client, it can store the 'sender' value in an attribute and uses it to respond to the source of the signal, using the notation shown in 1 above, e.g. (assuming the sender was stored in an attribute theClient) theClient.sigToClient()

3. The definition of the signal sent by the client to the server includes a PID value; the client includes its identity (this) in the signal it sends to the server, which uses it to respond, using the notation shown in 1/2 above.

In general option 2 or 3 is likely to be preferable because it is up to the clients to request service from the server, which responds to wherever the request came from.

HTH
Ian

-------------------------
=============
Ian Barnard
Principal Consultant
Telelogic UK, an IBM company
Report this to a Moderator Report this to a Moderator
 2-Nov-2006 18:16
User is offline View Users Profile Print this message


Ramandeep Ahuja

Posts: 10
Joined: 25-Sep-2006

Answer Answer
Thanks Ian, this is the method I have been using! Best Raman

-------------------------
Raman
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.