How to control one server with multiple clients via TCP/IP

I am wanting to control a single server with multiple clients.  Only one client would be active at a time, so there would be no conflict.  I want to use TCP/IP.  So far, I have programmed a cluster that passes data back to the server with no problems.  The challenge come in when a second client is added to the mix.  I have't been able to figure out how to turn each client on and send the appropriate data and then turn it off so it doesn't keep sending the same data to the server. 
Here are the things that I have considered and did some preliminary testing, but don't really know how to impliment:
1.  Send a numeric on the front of the cluster packet that tells the server that data is on the way.
2.  Send a boolean on the front of the cluster packet to somehow turn the server TCP/IP on.
The problem I have found is that LabVIEW TCP/IP doesn't like to be turned on and off.  If it doesn't get the data it expects, it goes into a reset mode and that kills the response time.
Any help?

You should consider implementing a set of simple one-byte commands that can be sent back and forth between the Server and the Clients. You can base all of these ideas off the example in the Example Finder under Networking >> TCP and UDP called Multiple Connections - Server.
You will have two loops in the server VI: one to wait for new connections, and one to send and receive data from the existing connections. For instance, after one of the clients connects, it can request control of the server to send data to it by sending the character "R" for request. Every time the send/receive loop of the Server executes, the first thing it can do is to check all the existing connections to see if any of the clients have sent a control request ("R"). If so, it will create a buffer (array) of control requests. This could be in the form of Connection IDs or indexes in the array for a particular Connection ID. Your choice.
After the Server receives a request for contol, if it is not already under control by another client, then it can send a response to the first client on the control request list. For instance, the server could send the first client a "S" command for send. Note that after the clients send their control request, they should execute a TCP Read and wait indefinitely for the server to respond with the one-byte "S" command. Then, once the client in control is finished sending data to the server, it could send the character "X" telling the Server to release it from control.
The example I mentioned above already does a similar thing. Note how when a client wants to disconnect, they send the letter "Q". You can see this in the Multiple Connections - Client VI. The Server then checks each individual connection to see if it's received this one-byte command, and if it has, it closes the connection to the client. This is what you would want to implement, but instead of having just one command, you'll have to distinguish between a few and build up a buffer of control requests.
Finally, if a client does decide to disconnect in your application, they could send the command "Q" just like the example above. At this point, close the connection and remove that Connection ID from the array of connections. You will also have to handle the case that this client was in the request control waiting line when it disconnected, in which case you need to delete it from that array as well.
This will definitely work for you, but it will take some work. Best of luck!
Jarrod S.
National Instruments

Similar Messages

  • How does create a server with multiple Clients ?

    Any people can lead me .
    How does create a server with multiple Clients ?
    Thanks

    For a multithreaded server you will need a thread to listen and at least one thread per client. If the conversation is half duplex, one thread per client works very well, if it's full duplex you will find one thread to send and one to receive much easier to program.
    I posted a Simple Socket Server that uses 1+2*clients threads.

  • How to have one provider with multiple portlets in JDev 11g

    Hi,
    I am trying to create Oracle PDK Portlets using JDeveloper 11g but for each portlet JDeveloper is creating a provider. As In JDeveloper 10.1.3.4 we can have one provider with multiple portlets in it. But JDev 11g creates provider for each portlet. How can we have one provider with multiple portlets in JDev 11g. Is it something changed in 11g version or am I doing it wrong. As the Help says we can have multiple portlets in one provider but when creating portlets it does not do that. Any help is appreciated.
    Thanks

    Hi,
    I am trying to create Oracle PDK Portlets using JDeveloper 11g but for each portlet JDeveloper is creating a provider. As In JDeveloper 10.1.3.4 we can have one provider with multiple portlets in it. But JDev 11g creates provider for each portlet. How can we have one provider with multiple portlets in JDev 11g. Is it something changed in 11g version or am I doing it wrong. As the Help says we can have multiple portlets in one provider but when creating portlets it does not do that. Any help is appreciated.
    Thanks

  • Server with multiple clients

    Hey all,
    I'm working on a simple Snake-like Java game - I'm done with the basics but I want to add in multiplayer capabilities. The game is not very complicated (hence I'm not posting on the game forum), but I have very little experience with network programming. I do know threading and GUI/Java2D stuff fairly well so that will be less of a problem. As far as the game itself goes, I want everybody to be able to see what everyone else is doing.
    As for the networking, basically what I want to do is as follows:
    1. One person runs the program and hits the "start server" button. This displays his IP and creates 7 new mini-screens for the other players. This also starts the server thread. (All of this is done already).
    2. The server thread will do a few things: 1) It will "listen" to any incoming connection requests and connect them to the server. 2) It will accept UDP datagram packets from the connected clients. It will process these and send the information to all the other clients. 3) It will monitor the state of the game and notify the clients about events like a player losing, the game ending, someone disconnecting.
    3. A client thread will be spawned in a program that connects to the server. The client thread will 1) send the server updated information on its state at set intervals. 2) Receive information from the server on the other clients at intervals.
    Obviously there is a whole lot more to consider, with special cases like someone disconnecting, the server crashing, etc. For right now, though, I just want to get the basics up.
    I've read through the Networking tutorials on this site, but I'm having trouble with a few design/technical issues even after looking through them.
    1. At a basic level, should I really be using UDP here? It seems like the better choice for fast games.
    2. Should I be using the MulticastSocket class? It seemed right initally but I got the impression that all clients I broadcast to would have to be in the same IP range, which is not the case here (I want Internet games to be possible).
    3. I'm not sure what I should be sending back and forth. From reading the tutorials my impression is that you can only send 256-long byte arrays in each packet. Does this mean I have to arbitrarily assign each byte in this array a meaning in the program? What if I have more than 256 bytes of info. to send?
    4. My basic idea was for the server to spawn and fork a thread for each of the connected clients, and for each client to spawn and fork a thread for all the other players in the game so that if someone crashes, disconnects, leaves, etc. only the thread responsible for displaying/updating their part stops. Is this the ideal setup? Is there a better way to handle this type of network model?
    5. The client/server need to be monitoring a few different things - should I just combine all this information into one big packet or separate it?
    Sorry for the long post, but I'm somewhat confused on what to do here.
    Thanks for the help!

    Thanks for the quick reply - I'll change around my design to use what you suggested. On a related note, how much slower, empirically, is TCP compared to UDP? For this application I need ping times between 300 and 500 ms for each of the clients.
    Also, regarding transferring information via TCP - since this is done with Buffered Read/writers can I transfer more back and forth? Basically I need to send the score (an int), as well as positional information for each player (could be as big as 50-100 ints). I'm worried that sending this volume of information is going to slow everything down quite a bit since not everyone has broadband. If I really have to be sending hundreds of ints a couple times a second to everyone, should I figure out a better way to do this? As long as each person's connection is at least 14k or so it should be ok, but it will also monopolize most of the bandwidth (at least with dialup connections).

  • How to use one PSE with multiple URLs?

    I need to hit my DMZ SAP Web Dispatcher with multiple unique URLs.  I am starting off using webdisp1.abc.com and webdisp2.vde.com.  DNS will resolve both the Web Dispatcher Host.  Following Tobias Winterhalter's Blog: Name-based virtual hosts and one SAP Web Dispatcher to access multiple SAP systems.
    My question is how do I go about generating the pse so I can store both webdisp1.abc.com and webdisp2.vde.com?  Do I just import the first request and initiate another certificate request using the same pse?
    Example
    sapgenpse gen_pse -s 2048 -p D:\<file path>\SAPSSLS.pse -r D:\<file path>\webdisp1.req CN=webdisp1.abc.com, OU=IT, O=XYZ Inc., C=US
    Cheers,
    Dan Mead

    Hi Daniel,
    what you are looking for are so called SAN certificates. As Martin said, with sapgenpse you are pretty out of luck. However you can create the certificates using openssl and then use sapgenpse to import them into a pse. There are a number of guides on how to create SAN certificates on the web, like the one mentioned by Martin from CAcert (which is one of the best imho) or this one. And there are also guides on the internet on how to convert OpenSSL keys to PSE.
    You should however keep in mind, that SAN certificates are more expensive than standard certificates. Therefor they only pay if the hostnames in there are stable for the lifetime of the certificate. If the hostnames need to change once a year, you already will be better off (from a cost perspective) by creating one pse per hostname an let the webdispatcher listen to different addresses, as each hostname requires a new certificate signed by the CA.
    Please also make sure, the systems and browsers connecting to your webservers are able to understand SAN certificates. For SAP systems this requires at least pl24 of the sapcryptolib.
    Kind regards,
    Patrick

  • How to access web server with SSH client

    I need to access my web server via SSH. I do not have clue how to go about. I have transmit for ftp but looks like I cannot use SSH with Tranmit.
    I guess I need to know:
    - What ssh client to I need to get?
    - If not detailed instruction provided How do I go about? I know I need the port # and my ip address and I have both of those but not sure what else I am to do.
    TIA for the help!

    Open up Terminal. It's in the Utilities folder.ssh -p <port#> <ipaddress> or, if you need to log on with a different user namessh -p <port#> <username>@<ipaddress>

  • How to use one application with multiple schema without copying application?

    Hi,
    Previously we are using oracle forms and by that we can manage by using a set of folders containing fmx and use different schema/database for different customers. so the source code comes from one individual file but used for different database users.
    is it possible to do this without copying application in apex?
    reason is because if applications are copied for each customer, and in a situation where a page has a bug, the developer must correct multiple pages across all the application. This would not be appropriate to manage.
    could this be done in apex? or is there any other approach?

    Hi,
    An application is tied to its parsing schema, so it is not possible to have one code base which you can then point to different schemas. I have seen some threads relating to dynamically setting the parsing schema, but I don't think it has worked to well, and would not be a supported configuration by Oracle.
    The normal way to do this is to have one schema and for each entity where it is logical you will have an extra key which is the customer id. I mention where it is logical, because not every entity needs its own data defined by customer. Some data will be common across all customers, such as lookup data and some entities will comprise child entities by which the data separation will be implied by the parent. You can then use Oracle's Virtual Private Database feature to implement a seperate view of the data through the application, based most likely on the customer who is logged on.
    Hope this helps.
    Regards
    Andre

  • How to return one ROW with Multiple value seperated by Colon in a SQL Query

    Hi,
    I have a SQL query as mentioned.
    select deptno
      from deptI want to mofidfy this query, so that this should return me department list with colon delimeted in one ROW.
    10:20:30:40.......Thanks,
    Deepak

    In 10g:
    select rtrim(xmlagg(xmlparse(content deptno || ':')).getstringval(), ':') data
    from   dept;
    DATA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    10:20:30:40with apologies for the abuse of XML...

  • How to integrate MSSQL server with SAP CRM via XI? Please help!

    Hi Experts,
       I have a requirement where I have to pull the data from MSSQL server and send it to SAP CRM.
       What are the different options avaiable with or without adapter to send data from MSSQL server to XI?
    As per my understanding I have following options:
    1. JDBC driver.
        MSQL ---> JDBC adapter ---> XI
    2. Create webservice for the XI outbound interface (Sender interface) and call it from MSSQL stored procedure.
       MSQL ---> SOAP adapter ---> XI
    2. Create webservice for the XI outbound interface (Sender interface) and call it from a .Net program.
      MSQL ---> DotNet application --> SOAP adapter ---> XI
    Which option is the best?
    Please help.
    Thanks
    Gopal

    Hi,
    Kindly refer:
    xMII 12.0 : Connecting to a Microsoft SQL Server 2000
    /people/ted.teng/blog/2005/12/28/use-sql2005-to-connect-and-present-sap-on-sharepoint-business-scorecard-manager-150-part-i
    Use SQL2005 to Connect and Present SAP on SharePoint / Business Scorecard Manager - Part IV
    Hope this might be of some use to you...........

  • How do i take one layer with multiple selections...

    how do i take one layer with multiple selections and make those selections their own layer?

    Yes sir. It w was really hard to explain. It is discontiguous segments that are separated by transparent areas. And I want those non transparent areas to be on their own layer. I have a photo shop file that has a bunch of buttons on them and they are on a transparent background. It is one layer. I want to select all the buttons and put them on their own layers. I can do this manually by selecting a button and cmd Just to a new layer, but when I have 200 buttons it is a daunting task.
    Sent by MailWise<http://www.mail-wise.com/installation/4> – Your emails, with style.

  • One order with multiple lines in OM is creating multiple invoices

    Application: Oracle 11i (11.5.3)
    Modules implemented: GL, OM, AR, AP, PO and CM
    Business Requirement:
    Our client would like to create Order consisting of multiple lines in Order Management.
    The Orders created in OM with multiple lines could be booked, picked, released and transferred
    over to Accounts Receivable. On transferring over the Orders from Order Management to Accounts
    Receivables using Auto Invoice process the Order should create ONE invoice with multiple lines.
    Moreover, for the multiple lines created on an invoice deferred revenue could be applied.
    ( eg. An order is placed for software and support. The support is to be invoiced all at once but revenue deferred to 1/12
    recognized each month as revenue is earned.)
    Right now we are getting two invoices. It is putting the deferred revenue item on a seperate invoice. Is this normal
    functionality? How can I get both on one invoice.
    thanks

    Hello Monique,
    Well you can have one invoice generated for an order with multiple lines. This is possible by changing some rules in Account Receivables. Use the grouping rules under setups->autoinvoice in AR. You can club your invoices based on any of the columns of ra_interface_lines_all. Hope this works for you.
    Arvind

  • Sql server with multiple instance

    hi  All,
    i want  to  install sql server with two instance   and i want  to assign two  separate is  ips   for  both   default instance  and named  instance   and  both   should  work like
    two different server
    note:  If i  logged  with  one  ip(default instance)   it should  show  its  own  databases  not both or  named   instance  databases
    thanks 
     chintala

    Hi chintala,
    According to your description, if you want to assign the two different IP to stand for default instance 
    and named  instance, I recommend you set up aliases on a SQL Server with multiple instances. For example, a physical server is named WinServer and 2 instances of SQL Server named WinServer and WinServer\instance1.
    We need to add 1 IP addresse to the WinServer, there is one IP address already assigned to WinServer, 192.168.1.1, by adding one new IP's, 192.168.1.2 .
    We need to move into DNS to configure our host names and aliases.  The physical machine must be steup as a static IP in DNS. SQLAlias1, which point to the default instance on WinServer, will be setup as a DNS with an address of 192.168.1.1.
    SQLAlias2, which will point to WinServer\Instance1, will be setup as a new Host (A) record in DNS with an address of 192.168.1.2.
    When everything has been completed on the DNS side, you need to open up SQL Server Configuration Manager on WinServer and configure the protocols for each instance one at a time, restart the 3 SQL services.
    For more information about how to set up aliases on a SQL Server with multiple instances, you can review the similar article.
    http://kevine323.blogspot.com/2013/08/setting-up-aliases-on-sql-server-with.html
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Issue listeneing queue from Weblogic Cluster server with multiple managed server

    Haveing issue listeneing queue from Weblogic Cluster server with multiple managed server.
    Weblogic Cluster structure is like
    Weblogic Cluster01
      --ManagedServer01(http://server01.myhost.com:7001)
      --ManagedServer02(http://server02.myhost.com:7001)
    JMS Servers
      JMSserver01 targeting: ManagedServer01
      JMSserver02 targeting: ManagedServer02
      JMSmodule
      ConnectionFactory01 targeting:JMSserver01,JMSserver02
      UDQueue01 targeting:JMSserver01,JMSserver02
    Uniform Distributed Queue in Monitoring tab showing like this
      mysystemmodule!JMSserver01@UDQueue01
      mysystemmodule!JMSserver02@UDQueue01
    So when I am sending message to any Host(by specifying the provider URL) its distributing equally on both server like
      mysystemmodule!JMSserver01@UDQueue01 10
      mysystemmodule!JMSserver02@UDQueue01 10
    But when try to listen message from these queue, it is listening from one server, for which URL given to connect.
      mysystemmodule!JMSserver01@UDQueue01 0
      mysystemmodule!JMSserver02@UDQueue01 10
    untill I connect to other server by giveing its URL, will not able to access other message left on the queue.
    Solutions that tried
      1) we have tried give both server URL coma sparated in provider URL
    we need to configur same scenario for 5 managed server with 3 listener on other servers.
    Do any one have solution for this.

    You need to have:
    1. Consumers connected to each UDQ member
    OR
    2. If no consumers in some of the members is expected, you can configure Forward Delay (specify the amount of time, in seconds, that a queue member with messages, but with no consumers, will wait before forwarding its messages to other queue members that do have consumers):
    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e13952/taskhelp/jms_modules/distributed_queues/ConfigureUDQGeneral.html
    For example you can set it to 10 (10s)
    Additional Information here:
    http://docs.oracle.com/cd/E23943_01/web.1111/e13727/dds.htm#i1314228
    http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/mbeans/DistributedQueueBean.html?skipReload=true#ForwardDelay
    How Does JMS Load Balancing Work with Distributed Queues and Uniform Distributed Queues? (Doc ID 827294.1)
    I hope this helps
    Best Regards
    Luz

  • Anyone have a fully functioning thread server ? (any server with the client

    Anyone have a fully functioning thread server ? (any server with the client source code) ? can u share it to me ? please ? I'm very hard to find a fully functinal example....
    thx ........

    Why not just write one yourself, it's not that hard. If you can't, then maybe you should learn how to write one before you try to use one.

  • How  to integrate File Server with Portal??

    Hi all,
    can any one tell me that how interegate the File Server With Portal Server??
    In my portal server under home tab i have sub tab (second level navigation) of File server.Whe i click this tab it throws an syntax error
    ie
    System Error
    An exception occurred during the program execution. Below you will find technical information pertaining to this exception that you might want to forward to your system administrator.
    Exception Class  :: class com.sapportals.wcm.repository.NotSupportedException
    Exception Message  :: Not Implemented
    thease are the steps that i have taken
    >created HTTP System..
    >created WebDAV Repository.
    >Created Cache.
    >Created KM WebDAV System.
    >Created Iview and in iview i have to specify the <b>Path to Initially Displayed Folder</b>
    i have specified the folder of file server that i want to display..
    but i get the same syntax error ..
    infact i dint get that folder in KM.
    But when i specify the folder that is present in KM its Work fine..
    Now the Scnerio According to me is that File server is not integrated properly
    if it would be integrated properly i would be able to see the folder of File server in  KM...
    am i correct ??
    please Guide me to integrated the File Server Properly??
    Points will be given for any help..
    Regards
    Vinit

    Hi Vinit,
    if you want some Windows File Server integrated into Portal, please do not use a WebDAV Repository, but use the File System Repository instead. Therefore you need to configure the according Repository Manager. Please refer to this documentation:
    <a href="http://help.sap.com/saphelp_nw70/helpdata/en/ed/b334ea02a2704388d1d2fc3e4298ad/frameset.htm">Integrating Documents from a Windows System into KM</a>
    HTH,
    Carsten

Maybe you are looking for

  • How can I securely erase my Apple TV's Hard Disk?

    The 40 GB drive is too small as everyone is experiencing and I need to upgrade my Apple TV's hard disk to a 250 GB drive that are now available. I thought of doing it myself but it is not quick and I do not have the time people are reporting. Therefo

  • Can't Download Itunes 7

    Please help! Itunes 7 will not download. It comes up as Win32 not valid application. I've tried shutting off Norton and Pop up blockers. No success.

  • Printing - what's wrong inside....

    Hello, I'm trying to display the content of a JPanel onto a HP laser printer but I want to reduce the margins to 1cm from the top and 1cm from the left (converted it must be 30 pixels I think)... Here is a part of my code preparing the printing proce

  • Can't download previously purchased Elements on new Macbook

    I purchased Photoshop Elements 12 in November 2013 and downloaded it to my Macbook Pro. I recently bought a new Macbook and wanted to install this previously purchased version of elements. I went to my order history on the Adobe site and pressed down

  • CFFUNCTION returntype error

    "The value returned from the addRequirement function is not of type query" is what I get when I execute the below function. This works fine in 7, but in 8 I get that error. Any ideas? <CFFUNCTION NAME="addItem" output="false" returntype="query"> <CFA