Handle Received data of Multiple TCP clients on TCP Server by displaying them into Datagrid

Hello All,
I have developed a C# based TCP server GUI application which is accepting the data from multiple TCP clients on TCP server.
The data i am receiving from TCP clients is a 32 bit data. In my application multiple TCP client data goes like this:
00012331100025123000124510321562
01112563110002512456012451032125 and so on...
Now i want those data of the TCP clients to be parsed into 4 bits first and display it in 8 columns (32/4=8) of (say) datagrid as each 4 bit represents some characteristics of the TCP client. The same thing
should work for next TCP client on second row of datagrid.            
Can you give me some suggestion or an example how to go about this? Any help would be appreciated.
 Thank you in advance.
Here is my code for receiving data from multiple TCP clients.
void m_Terminal_MessageRecived(Socket socket, byte[] buffer)
string message = ConvertBytesToString(buffer, buffer.Length);
PublishMessage(listMessages, string.Format("Sockets: {0}", message));
// Send Echo
// m_ServerTerminal.DistributeMessage(buffer);
private string ConvertBytesToString(byte[] bytes, int iRx)
char[] chars = new char[iRx + 1];
System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
d.GetChars(bytes, 0, iRx, chars, 0);
string szData = new string(chars);
return szData;

Now i want those data of the TCP clients to be parsed into 4 bits first and display it in 8 columns (32/4=8) of (say) datagrid as each 4 bit represents some characteristics of the TCP client. The same thing
should work for next TCP client on second row of datagrid
If mean it's a Windows Forms application and you want to display those bits in a DataGridView control, then please see these threads:
Add row to datagridview
Programmatically add new row to DataGridView
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How do you receive data from multiple people on a single port?

    I am trying to make a server where it receives the data from multiple users and then send it back to them all- multicasting audio to be exact. I tried setting it up but when i open the RTP session i get "can't open local data port" if i have more than one used connected to me. Does anyone have a solution? I didnt find much on the samples page and the multicast example from http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/javax/media/rtp/RTPManager.html
    didnt help either- i used the same ipaddress for the initialize and addtarget but i get "Local Data AddressDoes not belong to any of this hosts local interfaces". I am really in a pickle... If anyone can help me out that would be great!
    EX: If A,B,C want to multicast they will all send to Server S using port 3000. Server S will create listeners for each of them using port 3000 and when received data it will send back to all of them at 4000. This is what i am trying to do... should i make multiple threads? would that help? thanks and please help!

    To send to everyone, you can send to a multicast address (choose one from 224.0.0.0 to 239.255.255.255), on a given port (2000). I don't have any code example here but it should very similar to unicast. As you said, you just have to register the Session and add a target with this same address.
    I don't have any example myself, but you should find code example of both server and client around. It is a very common usage of jmf rtp.
    I don't know how to mix several audio streams together (never had to do this), so I'm afraid I can't answer your other questions, sorry... The only way to know if it will slow down the transmission is to try. :)

  • I have registered products under multiple appleIDs. I would like to merge them into a another. How?

    I have registered products under multiple appleIDs. I would like to merge them into a another. How?

    You do not.
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    Frequently asked questions about Apple ID
    Or maybe this since it is not clear what you want to do
    iOS: Transferring information from your current iPhone, iPad, or iPod touch to a new device

  • TCP client and TCP server...

    i m doing a project in GUI form, where the client need to enter data in text field and the data will be pass to server to process, for example if client click button "ADD" then a particular data will pass to server and do sth (save data into a file), or if client click button "DELETE", the client is actually call server to delete a particular file stored in server, how can i do it using TCP socket ??

    Hi,
    Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
    According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    Console.WriteLine(exception.Message);
    Unable to read data from the transport connection: An existing   connection was forcibly closed by the remote host.
    By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Multiple WUA client fails if server delays in sending response.

    Hi,
    I have implemented my own minimal WSUS server which provides updates to wua client using MS-WUSP protocol. I have used Sqlite as back end database to store update metadata(size of metadata is apprx. 4-5 GB). I have implemented multi- threaded web service,
    each thread handle a separate request from WUA client.
    When I tried to scan with more than 20 clients at the same time, then some of them fails with error 0x80072ee2 -
    ERROR_INTERNET_TIMEOUT The request has timed out.
    Is there any solution to avoid this kind of failure? Can I change the WUA client's timeout period? How can I speed up my server application to handle multiple requests?
    Thnaks in advance.
    Vivek.

    Hi,
    What are the operating systems of your clients? Please update the latest version of Windows Update agent:
    https://support.microsoft.com/kb/949104?wa=wsignin1.0
    In addition, please check if multiple un-declined/superseded updates in the WSUS server's catalog.If yes, you can declining superseded updates to eliminate such performance issues.
    Furthermore, the performance depends on several factors. You can check the task manager to check if any process has a high usage of the CPU, memory or disk. Or you can use performance monitor to diagnose disk/network/memory/process/processor bottleneck on
    the server and clients:
    https://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx
    Best regards,
    Susie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to handle received data after client timeout

    I believe this is a common question and sorry if it is asked and answered before. I didn't find the answer.
    I have a client/server app. there mainly two threads. one is to handle my regular GUI command, and the other one is to check if the server is still alive by sending ping command every 5 seconds. I set the client timeout 10 seconds. My problem is as the following:
    1. client sends a command CMD
    2. Client timeout after 10 seconds
    3. The background thread sends a Ping command
    4. Client received the response for the first command CMD
    5. then the client assume the response is for the Ping CMD and mismatched!
    I am thinking about using the following ways to handle this issue, wondering if anyone could let me know if they are ok and which one is better. OR there could be a better solution altogether.
    Method 1 - if client time out, close everything, consider server is dead. try to re-establish connection again
    method 2 - attach a ticket to each command and response, so that they can be matched regardless the order it is receive.
    Thank you very much!
    livz

    Thanks for all the replies.
    I use the ping to check if the server is connected and a lot of my GUI functions are enabled/diabled based on whether the server is in presence. for example, certain buttons or operations are disabled if the server is disconnected. I didn't find a better way to handle this. Please advice if there is anything better.
    10 seconds was randomly chosen based on experience. It works most of the time but sometimes it times out.
    again, thanks a lot for any advice!
    livz

  • Bad date format in generated client API (weblogic server Workshop)

    Hello,
    i'm making web service client from oracle weblogic workshop.
    I have used "clientgen" Ant task to generate the client library.
    The WSDL indicates that certain fields are of type xsd:date.
         <xs:complexType name="declarationType">
              <xs:sequence>
                   <xs:element ref="directive"/>
                   <xs:element ref="deadline"/>
                   <xs:element ref="complete"/>
                   <xs:element ref="transposition"/>
                   <xs:element ref="comment"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="deadline" type="xs:date">
              <xs:annotation>
                   <xs:documentation>Deadline (date) for executing this directive.</xs:documentation>
              </xs:annotation>
         </xs:element>
    So in the API generated, i've a function generated to set the deadline with java.util.Calendar as parameter.
    If i construct my message and pass 2010-07-06 to the function that initialise the deadline date(in yyyy-mm-dd)
    The web service client sends "2010-07-06+02:00". (because i'm locate in Bruxelles in Belgium)
    However, the server expects "2010-07-06". (yyyy-mm-dd)
    So how can I do to pass it correctly?
    i've tried in a message handler, but i've to sign the body of the message.
    So when i modify the body in the handler to format the date, i receive an error from the server because the signature isn't valid.
    How can i change the format of the date passe, before signing of the body.
    thanks in advance.

    By "client's principle", do you mean the identity of the user who got logged
    in? You should be able to call HttpServletRequest.getUserPrincipal() or in
    EJB land SessionContext.getCallerPrincipal(). Also, if this is the identity
    you are interested in you just be able to call the EJB and then use
    getCallerPrincipal() as the identity should be propogated across the wire.
    - Neil
    "Raymond Tiong" <[email protected]> wrote in message
    news:[email protected]..
    >
    I'm posting this at the risk of sounding as if I didn't read thedocumentation
    before hand. (Which I've only glanced through to be honest.)
    I want to be able to retrieve the SSL information, particularly theclient's principle
    in order to pass it to an EJB to retrieve user specific information.
    Is this possible? If how, what are the steps in general?
    In Workshop, in the JWS file, which api's do I call?
    Thanks in advance,
    Ray

  • Data transfer between C client and Java server

    Hello there
    I am working on a project where I have to develop a Client based on C and Server based on Java. The client can connect to Java server and it then sends a integer/string to Java server. But.. Java server unable to receive that and throws an IOException.
    I use write method to send the integer buffer to the socket.
    int out_buffer = 0;
    int *pbuf;
    pbuf = &out_buffer;
         if (write(acskfd, pbuf, 4)< 0){
                   syslog(LOG_ERR,"Write failed. %s(%d)", strerror(errno), errno);
                   printf("\tCLIENT:\tWrite failed\n");
                   exit(1);
    In Java, i use DatainputStream and readnInt method to read the integer from the stream.
    cl_sock = socket_out.accept();
    DataInputStream sInput =new DataInputStream(cl_sock.getInputStream()) ;
    int cmd = sInput.readInt();
    Am I missing someting.. Any suggestions would be really really helpful.
    Thanks
    Ithaca
    PS: I running both programs in the same machine.
    In C part, I also use host to network byte order conversion (serv_addr.sin_port = htons(portno).

    I would suggest writing a Java client to perform the same tasks as the C client.
    Then if the Java client does, or does not work this can help dteremine which end is at fault.
    Are you flushing your data from the client?

  • Need to POST data from a desktop client to a server.

    Hello all, it's been awhile since I've posted here, so I hope everyone has been doing well.
    I have cross posted this here java - Need to POST data from a client application to my server - Stack Overflow but no answers, and since SO has been extremely slow for the questions I've been asking I am posting here.
    Here is the post:
    I know the title is probably a common question, but I am a bit confused on everything I'm trying to do, so I am trying to piece it together, and figured a common title would be better than a confusing one.
    I am basically developing a web application and one part of that is a file uploader. I am using Apache Commons File Upload via the Streaming API, and that all works fine, except I need to access the file I'm uploading, because that contains data to additional files to upload.  I.e., Read File A, get paths to images, upload images with File A to server and save on server.  The API can be found here http://commons.apache.org/proper/commons-fileupload/streaming.html
    I was told there is a security risk via the web and would be impossible via a browser, since the user needs to select all files to upload, i cannot tell the browser to upload additional files, so I am left with a client side option.
    I am confused if there is a special library I need, or as I have been seeing threads that talk about using the built in UrlConnection Class or http://hc.apache.org/
    I basically need to be able to read the file, which technically gives me a path to a Database on the user's system which I then read to get the additional images.  After I get all of that I then  need to post the data as a multipart form as that is what the FileUpload requires.
    form method="POST" enctype="multipart/form-data" action="fup.cgi">
      File to upload: <input type="file" name="upfile"><br/>
      Notes about the file: <input type="text" name="note"><br/>
      <br/>
      <input type="submit" value="Press"> to upload the file!
    </form>
    This is the example found in the Overview section of the Fileupload which can be accessed from the link above.
    There wouldn't be an issue if the users uploaded all of the data themselves, but since I have to do some of it automatically it causes some "concerns/issues."
    Basically these files are created and packaged from another application, so the images, and the db will always be in the same place, and that file that they are uploading is a file the other program creates, so everything will always be known, I just need to upload it, and then POST it as enctype="multipart/form-data" So that my servlet can read it and save it on my server.
    So I would appreciate it if anyone had any suggestions on where to begin my journey with this.  I have heard of a few applications like curl and wget that are used for this, but those seem to be more C based.  As mentioned earlier it seeems the httpcomponets from apache might work well, but I want to make sure.
    I appreciate all the help, thank you for your time all.

    It's not possible to read from a file without using classes from the core API*. You'll have to get clarification from your instructor as to which classes are and are not allowed.
    [http://java.sun.com/docs/books/tutorial/essential/io/]
    *Unless you write a bunch of JNI code to replicate what the java.io classes are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Labwindows tcp client to generic server

    I made a program fom the client sample in the TCP sample folder. Now I want that program to communicate to a generic server that doesn't have labwindows running on it. Is this possible with just a few minor edits or do I need to start from scratch with a different sample program?
    Solved!
    Go to Solution.

    I see, but I can't understand why it reports no error! The macro exits for return value <0: if directly passed to GetTCPErrorString should not return a "no error" string, neither should GetTCPSystemErrorString do.
    Are you sure you are not calling any other TCP library function before decoding the error? If this other function succeeds, it masks out the previous error.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Copy Local User Data from Multiple Computers to a File Server

    Just recently acquired a new company with 20 standalone computers (desktops and laptops, Windows 7 and 8.1), that are part of a WORKGROUP, with no local server at all. This site will be getting a network upgrade, and will soon have a VPN tunnel to the Main
    Office (but not until cutover weekend, a month and a half in the future).  Now, all these computers have local user accounts, and some are shared computers, so copying data to a centralized location is going to be bothersome (especially if people keep
    modifying/creating data everyday).  Not sure what to do...
    Would anyone advise on what to do in this case?   I'd like to minimize downtime for these users while migrating them to our domain. 

    Hello Fernando Chanco,
    I can recommend you to use the User Migration State Tool as this provides a highly customizable user-profile migration experience for IT professionals.
    User State Migration Tool (USMT) Technical Reference
    https://technet.microsoft.com/en-us/library/hh825256.aspx
    USMT Requirements
    https://technet.microsoft.com/en-us/library/hh824913.aspx
    Also this is an interesting document that points to this same tool (USMT) to accomplish something similar to your goal.
    How to migrate from Workgroup network model to Domain based model?
    https://support.microsoft.com/kb/555542/en-us
    Q: 
    How to migrate from Workgroup network model to Domain based model?
    A: 
    Network base Workgroup support a few hosts without central management. 
    After you company/network grow, you will have to start to migrate to network base on Domain model.
    The followings instructions will give you a guidelines to achieve this migration in the short and safe way. The guidelines assume that you migrate single place and serve SMB (Small Medium Business) network...
    Hope this info helps to reach your goal. :D
    5ALU2 !

  • My family has multiple itunes accounts, and would like to merge them into a single cloud account.  How do I do this?

    We are trying to combine music into a shared library so we can eliminate all of the duplicate purchases.  Is this possible?

    That's not exactly correct. It is possible to sign in to one account for media sharing and another account for iCloud. When you initially set up the device, it may automatically sign you into one account for everything, but you can go to preferences and change this.
    Each family member should have their own iCloud account for mail, contacts, calendars, photostream, etc, but you all sign into the same account for iTunes.
    Unfortunately there is no way to consolodate the media you have already purchased.

  • Connection of BI to Multiple SRM clients

    Hi,
    I am working on SRM/BW implementation. Now, in our project we are implementing multiple clients in SRM QA environment to support Testing and Training. 
    My question is,
    Can this be done ?
    If yes, What has to be done in BW system to extract data from multiple SRM clients in single environment and still segregate different client data in BW environment?
    SRM QA System client 100  ->BW QA System -
    >Query1 shows only SRM QA Client 100 data
    SRM QA system client 110 -> BW QA System---> Query1 shows only SRM QA Client 110 Data
    Thanks in advance.

    hi Raj,
    you can compound infoobject with 0LOGSYS ... or add it to your infoprovider,
    and map 0logsys with the client logical name
    take a look
    http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6399e07211d2acb80000e829fbfe/frameset.htm
    hope this helps.

  • Socket Communication between java client and c++ server

    HI,
    In my project,I want to do the following:
    1.Sending datas from client to server.
    2.Getting the response from server to client.
    I written the client in java.but the server is in c++.
    Is it possible to communicate with the server using java codings itself?
    Im able to send the data from my java client to the server.
    but unable to get back the datas from server to client.
    Can anyone tell me how to do this?
    thanks a lot

    hi
    thanks for ur reply.
    I didnt get any error msg while getting the back the datas.
    Actually i divided my application into two parts.
    My application will act as both server and client.
    server ll get the browser request and send to the client and the client will send that data to the c++ server.
    Im able to do that.and unable to get the data from server.
    Didnt get any error.
    can u tell me how to make an application to act as both client and server.
    I think im wrong in that part.
    thanks a lot

  • 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

Maybe you are looking for

  • Interactive Report Downloads only showing Column Headings

    I have an Interactive Report that is selecting more than 100 columns. I set the defulat to only show a few of the columns (the rest are dedaulted to not show). When I try the download option (pdf, rtf etc.) , it only shows the column headers (no data

  • NWA PI Message Prioritization

    Trying to use PI Message Prioritisation and I get the following message when logging onto NWA and selecting SOA Management   Monitoring   PI Message Prioritization. I Message prioritization data provider not registered for this PI have searched SDN,

  • IPod Classic 160Gb 6th Generation Won't Sync With Windows 7 Laptop

    Yesterday I purchased an iPod Classic 160Gb to replace my old iPod Classic that is on it's last legs (10 years old) My laptop recognises the iPod as a drive but iTunes does not recognise it at all. When I connect the iPod to iTunes the iPod shows it

  • Error : Activating transfer rules

    Hello Experts, I get the message "Error Generating Program" while activating the transfer rules. The detailed error message refers to RSAR245 or note 636217. Note refers to table row size being exceeding 1962 bytes. But my transfer structure row size

  • How long to share a simple 1080 project to Master File on 2013 iMacs or Mac minis?

    A friend has just bought a new basic 21.5"  iMac. He has made a simple 1920x1080 (AVCHD) project lasting just under an hour. It took him 15 minutes to share it to an H.264 Master File. Put another way, the sharing process was about a quarter the leng