TCP server stream loses data

Hi,
I have a high visibility application that has a bug in it that I'd like some
sharp minds of NI discussion forum to make a suggestion about.
The app is on the International Space Station. I have a LV executable on a
laptop on the ISS that sends TCP and UDP data to a LV executable on an earth-bound
computer.
The path is not a standard or "trivial" IP but it is intended to be equivalent to
a standard IP.  The catch comes when some data bytes are lost en route.
When this happens, the earth-bound LV says something like "Not enough memory
to complete operation"
Here's what we found...
=======================================================
The TCP Server (on the ISS) send a TCP data stream with the following format...
...LLLLSTART$d1$d2...$dN#llllSUMccccENDLLLLSTART...
where
    * LLLL is a 32bit binary integer with the number of bytes in the following packet beginning with the text string START and ending with the text string END.
    * $, #, START, SUM, and END are delimiters.
    * d1, d2, ... dN are text string data values.
    * llll is a text string with the decimal number of bytes beginning with the text string START and ending with # symbol.
    * cccc is a text string with the decimal number checksum of the bytes beginning with the text string START and ending with # symbol.
The TCP Client (on earth) reads 4 bytes as LLLL, then reads LLLL bytes (usually about 85 bytes) as the packet beginning with the text string START and ending with the text string END.
The error comes when the LLLL data is lost, so the TCP Client reads four bytes (probably S,T,A,and R) as LLLL, which convert to a number that is very large, then reads LLLL bytes (maybe 50M) but this read fails because there is not enough memory to read that much data.
The fix entails ensuring that LLLL is a reasonable size (like 20 to 200) and ensuring that the data packet begins with START.  The difficulty is how to restructure the code to reset the packet loop when LLLL is out of bounds or when that START header is not present.
=================================
My quandary is that in LV, I can't see what's going on in the TCP Server or
TCP Client vis.
Any suggestions will be appreciated.
JIM
Solved!
Go to Solution.

I would look at configuring the Nagle Algorithm and/or Delayed ACK options on your remote and earth-bound stations.
Do LabVIEW TCP Functions Use the Nagle Algorithm?
TCP Performance problems caused by interaction between Nagle's Algorithm and Delayed ACK
From wikipedia:
Applications such as networked multiplayer video games expect that actions in the game are sent immediately, while the algorithm purposefully delays transmission, increasing bandwidth at the expense of latency. For this reason applications with low-bandwidth time-sensitive transmissions typically use TCP_NODELAY  to bypass the Nagle delay.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Similar Messages

  • 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.

  • Fms live stream server stops sending data around 4+hrs

    Hi,
    I am having some issues with fms servers livestream connection. My rtmp client connects to the server ok and rtmp data flowing ok for about 4hours, in the wireshark trace I can see that the server just stops sending data roughly after 4hours. The server version is 3.5.1, and I also try it on a 4.0 server the data stops coming from the server as well after 5+hours. There are no errors or any indication of session disconneciton in the diagnostic logs.  I have also looked thru the settings in applicaiton.xml and server.xml I just don't see any obviious reason for the issue. I do send rtmp Acknowledgement to server after the client receives "window size" bytes, and the client sends ping response to server.  Are there any other that client needs to send back to server? It would be greatly appreciated for any pointers and help. Thanks.

    Updates:
    An interesting observation is that the server stops transmitting data when server-to-client bytes reaches ~4G. The number sounds too much like a system resource limitation. It is a live stream and it is not being recorded so I am not sure where is the 4G limitation coming from. FLVCACHE_MAXSIZE is for recorded stream, I think, and it is set to the default 500MB.
    Also, in the access log the check point for connect-continue and play-continue keep showing status of 100, which is supposed to be "Waiting for the application to authenticate.". Is this correct? The connection is successfully connected and play command is successful as shown in the access log. swfVerification is disabled in application.xnl. what does the server waiting for in respect to authentication?
    Below is the log:
    connect-continue
    session
    2012-03-22
    01:51:24
    Eastern Daylight Time
    10.200.4.224
    10.200.4.172
    1176
    1
    44
    _defaultRoot_
    _defaultVHost_
    live
    _definst_
    0
    100
    10.200.4.224
    rtmp
    rtmp://10.200.4.172/live
    rtmp://10.200.4.172/live
    file:///mac.flv
    LNX 9,0,48,0
    4702111234558869871
    3183
    3840850027
    normal
    file:///mac.html
    play-continue
    stream
    2012-03-22
    01:51:24
    Eastern Daylight Time
    livestream
    10.200.4.172
    1176
    1
    44
    _defaultRoot_
    _defaultVHost_
    live
    _definst_
    18044
    100
    10.200.4.224
    rtmp
    rtmp://10.200.4.172/live
    rtmp://10.200.4.172/live
    file:///mac.flv
    LNX 9,0,48,0
    4702111234558869871
    3183
    3840850027
    normal
    livestream
    rtmp://10.200.4.172/live/livestream
    rtmp://10.200.4.172/live/livestream
    flv
    18085866
    0
    3829693036
    1
    file:///mac.html
    -1
    -1.000000
    Any pointers would be greatly appreciated. Thanks.

  • How to listen out for a stream of data coming from (web)server

    Hello
    I have an applet that connects to a server (same location as web server) and connects to a server on a socket. This all works fine for sending commands to this server. But the server can send data to the client at any moment in time. So how do I listen out for the activity? do I launch a separate thread that sits listening for incoming data?
    What is the way to do it?
    Angus

    Check out my InfoFetcher class
    http://forum.java.sun.com/thread.jspa?threadID=750441&messageID=4291848

  • Is it possible to create a virtual TCP port and send data to it?

    Is it possible to create a virtual TCP port and send data to it?
    My application is this:   I am reading a constant stream of waveform data from a device via a LabVIEW VI set and I need to get that streaming data to a .NET application.  I can poll a TCP port in .NET easily so is there a way I can create a virtual TCP port in LabVIEW and send the data there?

    Have a look at the example called simple data server and simple data client and see what you can get from that. I'm not really familiar with TCP myself.
    Joe.
    "NOTHING IS EVER EASY"

  • How can I fix consistent TCP timeout and make data flow simpler?

    Hi!
    I'm acquiring data from a Scanivalve Digital Scanning Array through a TCP/IP connection. I'm having problems with the connection timing out regularly. It will run fine if you take data several times in a row, but if the VI sits for several minutes (while looking at previous data runs or adjusting test setup) the connection will timeout the next time you try to take data. The subVIs (reading the tcp connection, processing the data pakcet, etc) were provided by the manufacturer several years ago. The midlevel VI were written by another engineer, and I adapted them to run with the top level VI that I needed for this test. The data flow in the VIs are convoluted and while I can follow the ones t
    hat I wrote, I'm not sure how to troubleshoot the others.
    I posted a question on an unrelated problem and the responses mentioned that race conditions were going to be a problem b/c of all of the global variables.
    Please be patient with my lack of knowledge in some areas. Any help would be appreciated.
    Thanks so much!
    -Sarah
    Engineering intern
    Techsburg, Inc.
    Attachments:
    DSA_Acquistion_VIs.zip ‏253 KB

    I'm not positive about the best solution in this situation, but there is lots of information available regarding error 56 when using TCP/IP communication.
    You might find some of these useful:
    Error 56 Occurred at TCP Open: Windows XP Fails as TCP/IP Server with LabVIEW 6.1.
    Error 56 Occurs When Using TCP Listen.vi
    TCP/IP Error Codes and Related Time-out Issues in LabVIEW

  • Problem:100 % cpu usage with tcp server dll

    Hello,
     I am trying to write a dll with labwindows/cvi that allows me to create a TCP Server. This dll is integrated in labview.I created this Dll with example provides by Labwindows/cvi(rtserver.dll).
    Description of my problem: when i execute this dll in a "While Loop" in labview,the TCp server wait a connection and 100% cpu usage occurs. However when a client is connect to the server,the CPU is normaly used because the program stop when he meets the timeout of the tcpread() function. I would like to know how i could limit CPU usage  when the server is awaiting a client in the labview "While loop".
    I know I could use a DELAY() to limit Cpu usage ,but I would like to know if there are any others solutions.
    thank you.

    i dont know your exact application, but i generally use Q to transfer data to TCP loop in my prgram it helps me in two ways.
    1. it automatically restricts the iteration when ther is no data (Less CPU Usage, Less Unnecessary Trafic)
    2. Q can eliminate problems arising due to non synchronization of loop
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

  • Streaming mp3 data

    Hi and thanks in advance to anyone willing to help out :)
    I was disappointed by the general lack of quality in every single J2ME app out there for listening to internet radio (and I'm not going to pay for something so simple), so I decided to have a go at it myself. I found out I could just use Manager.createPlayer() and pass the URL of the stream to it, and it would (I assume) play the stream without any problems.
    Now, the problem is that I want to parse and display metadata. In ShoutCast radio, a simple metadata block is inserted into the mp3 data at a certain interval specified by the server. This makes it fairly simple to read the metadata, however it means that passing the stream straight to the mp3 decoder will cause a glitch in the sound every second or so, so if I want metadata, I have to modify the stream before playing it.
    I thought this should be simple to do but it seems it isn't. I have been unable to locate a way to send data directly from a buffer in my application to the mp3 decoder for playback. The closest I think I got was creating a Player from an InputStream; this way after jumping through some hoops it seems to be possible to play audio from a buffer created by the app itself, but once it's finished playing I would have to destroy and re-create the Player in order to play the next chunk of sound. This would be extremely impractical and I doubt it would allow seamless playback of the stream, since it would have to interrupt playback everytime a block of metadata is received (which happens all the time, not just at song changes).
    So basically, my question is: is there a way (and if yes, what is it) to continously play audio, from my own data buffer?
    Thank you very much for your help! :)
    - dm from Hungary

    The Harman-Kardon manual for the DPR1005 has this to say about sending raw MP3 data to the unit:
    The MP 3 DSP mode found in the new DPR
    requires an MP3 SPDIF stream. Presently, only a
    few units provide this but in the coming generations
    of motherboards and operating system
    updates this will follow, since SPDIF is the standard
    for audio & video hardware.
    All the information I have found regarding this topic leads me to believe that that the iMac can not send raw data via the SPDIF output.
    However, Squeezebox can - http://www.slimdevices.com/pi_specs.html#outputs
    That is the only device I have successfully located that will stream MP3 data via optical, not just standard pcm.

  • How do I read/write many matrices through TCP server?

    I'm trying to modify the simple data client and the simple data server program in example in LabVIEW6i. How do I send a 2 dimension nummeric matrix? and also how do I send many numeric matrices at a time?

    The problem here is that at the receiving end, one cannot know how many
    bytes to read before unflattenning into the datatype.
    A method that works for *any* datatype (and any data transfer mechanism):
    Flatten the data to string.
    Flatten again the string to string; this adds a string lenght (U32) header
    to the string.
    Send the string.
    When receiving data, first read 4 bytes and convert to U32.
    Read this number of bytes.
    Typecast the string to the expected datatype.
    Jean-Pierre Drolet
    ----- Message d'origine -----
    De : "Mark Hanning-Lee"
    Groupes de discussion : comp.lang.labview
    Envoye : 6 septembre, 2001 22:21
    Objet : Re: How do I read/write many matrices through TCP server?
    > Lab Viewer wrote:
    > >
    > > Hi Irene,
    > > Re
    garding that example, probably you are wondering how can you pass a
    > > 2D array to Type Cast.VI (it accept only 1D array). The answer is
    > > Reshape Array.VI. Use this VI to transform your multidimensional array
    > > in a 1D array (after that use Type Cast.VI to transform it in a
    > > string). Also, you can use Array To Spreadsheet String.VI in order to
    > > obtain a string to send via TCP, but in this case the string is
    > > longer.
    >
    > Or better, wire the 2D array to the Flatten to String function, which
    > accepts any data type.
    >
    > When you receive the data, wire the string into the Unflatten from
    > String function. You'll need to wire a 2D array of the same
    > representation into the type input of that function.
    >
    > Mark
    LabVIEW, C'est LabVIEW

  • Need TCP Write Stream. vi to run fp_ftp.vi

    Hi,
    I my application, I want a Fieldpoint RT module to put files on a ftp server on our network. The ft_ftp.vi could be helpful, but while loading it stops claiming that the TCP Write Stream.vi is lacking on my system. I did not find this vi, neither on my PC or elsewhere on the internet.
    Please help me to locate this vi,
    Thanks,
    Frederik

    Dear sir,
    To use the TCP Write Stream VI you need to have the LabVIEW Internet Toolkit installed.
    This toolkit is an additional function librabry for LabVIEW which need to be bought seperately.
    Please refer to following article for more info.
    Additional information and pricing about the LabVIEW Internet Toolkit is available here.
    If you LabVIEW license is part of a Developer Suite, than the Internet Toolkit is included with this software bundle.
    Best regards,
    Joeri
    Best regards,
    Joeri
    National Instruments
    Applications Engineering
    http://www.ni.com/ask
    Make our forums great:
    If you like the answer, don't forget to "Kudos!".
    "Accept the Solution" if your question is answered!

  • Multi-Client TCP Server /w Swing GUI

    Hi everybody,
    i have to develop a Multi-Client TCP Server with a Swing GUI. The GUI mainly consists of a JTable which shows various trace messages from processes running on other computers. As the data needs to be filtered i�m using a custom TableModel derived from AbstractTableModel. I�m creating a new thread for every client that connects as shown in http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html
    Now every client thread reads data from its TCP connection and puts it into the JTable by calling the method addRow of the model. But i�m getting strange NullPointerExceptions and IndexOutOfBoundExceptions when data arrives (i�m using ArrayList in the model). These exceptions never show in a single-threaded Swing app (i�ve tested this already, so i don�t think it�s a bug in my model), so i think this is a problem with Swing�s thread unsafety? Do you have any hints on how to get away with it? Also general design tips for a Multi-Client TCP Server /w Swing GUI are greatly appreciated.
    Thanks in advance!
    Best regards,
    Disposable_Hero

    Of course, but i don�t think it is the model (as said before it works fine in a single thread swing app)
    Here�s the code:
    public class LogTableModel extends AbstractTableModel{
    private Vector dataVector;
    private Vector filterVector;
    private String[] columnIdentifiers;
    private Vector filteredbyProcess;
    private Vector filteredbyLoglevel;
    private boolean bEnableRefresh;
    /** Creates a new instance of LogTableModel */
    public LogTableModel() {
    dataVector=new Vector(0);
    columnIdentifiers=new String[]{"LogTime","HostName","IP","ProcessName","LogLevel","Handle","PID","TID","LogData"};
    filteredbyProcess=new Vector(0);
    filteredbyLoglevel=new Vector(0);
    filterVector=new Vector(0);
    bEnableRefresh=true;
    public synchronized void enableRefresh(boolean bEnableRefresh){
    this.bEnableRefresh=bEnableRefresh;
    if(bEnableRefresh){
    this.buildIndexListBasedOnFilter();
    public synchronized void addRow(LogLine row){
    dataVector.add(row);
    if(bEnableRefresh)
    this.buildIndexListBasedOnFilter();
    public synchronized void addFilter(Filter filter){
    filterVector.add(filter);
    if(filter.isActive())
    this.buildIndexListBasedOnFilter();
    public synchronized void setFilterActive(String name,boolean active){
    int i;
    for(i=0;i<filterVector.size();i++)
    if(((Filter)filterVector.elementAt(i)).getName().equals(name))
    break;
    Filter tmp=(Filter)filterVector.elementAt(i);
    tmp.setActive(active);
    if(active)
    this.buildIndexListBasedOnFilter();
    public synchronized void setFilterLoglevel(String name,int Loglevel){
    int i;
    for(i=0;i<filterVector.size();i++)
    if(((Filter)filterVector.elementAt(i)).getName().equals(name))
    break;
    Filter tmp=(Filter)filterVector.elementAt(i);
    tmp.setLoglevel(Loglevel);
    if(tmp.isActive()==false)
    this.buildIndexListBasedOnFilter();
    private void buildIndexListBasedOnFilter(){
    filteredbyProcess.clear();
    filteredbyLoglevel.clear();
    applyProcessFilter();
    applyLoglevelFilter();
    if(bEnableRefresh)
    this.fireTableDataChanged();
    private void applyProcessFilter(){
    LogLine line=null;
    Filter filter=null;
    for(int i=0;i<dataVector.size();i++){
    for(int j=0;j<filterVector.size();j++){
    filter=(Filter)filterVector.elementAt(j);
    line=(LogLine)dataVector.elementAt(i);
    if(filter.isActive()&&(filter.getName().equals(line.getProcessName()))){
    line.setHidden(true);
    break;
    else{
    line.setHidden(false);
    if(line.getHidden()!=true)
    filteredbyProcess.add(new Integer(i));
    private void applyLoglevelFilter(){
    for(int i=0;i<filteredbyProcess.size();i++){
    int index=((Integer)filteredbyProcess.get(i)).intValue();
    LogLine line=(LogLine)dataVector.elementAt(index);
    for(int j=0;j<filterVector.size();j++){
    if(((Filter)filterVector.elementAt(j)).getName().equals(line.getProcessName())){
    Filter filter=(Filter)filterVector.elementAt(j);
    if((filter.getLoglevel()&line.getLogLevelAsInt())!=line.getLogLevelAsInt())
    line.setHidden(true);
    else
    filteredbyLoglevel.add(new Integer(index));
    break;
    public synchronized String getColumnName(int columnIndex){
    return columnIdentifiers[columnIndex];
    public synchronized void clearData(){
    dataVector.clear();
    filteredbyProcess.clear();
    filteredbyLoglevel.clear();
    public synchronized int getColumnCount() {
    return columnIdentifiers.length;
    public synchronized int getRowCount() {
    return filteredbyLoglevel.size();
    public synchronized Object getValueAt(int rowIndex, int columnIndex) {
    int iIndex=((Integer)filteredbyLoglevel.get(rowIndex)).intValue();// hier krachts warum???
    LogLine tmp=(LogLine)dataVector.elementAt(iIndex);
    switch(columnIndex){
    case 0:
    return tmp.getLogTime();
    case 1:
    return tmp.getHostName();
    case 2:
    return tmp.getIP();
    case 3:
    return tmp.getProcessName();
    case 4:
    return tmp.getLogLevel();
    case 5:
    return tmp.getHandle();
    case 6:
    return tmp.getProcessID();
    case 7:
    return tmp.getThreadID();
    case 8:
    return tmp.getLogData();
    default:
    return null;

  • TCP server implementation: thead issue

    Hi,
    I'm not actually doing a TCP server, but I need to implement a similar threading model
    in my app, so this will serve as a good example. I have done a TCP server few times
    with different programming languages and here's a pseudocode how I do it
    do
        connection = waitForConnection(port, -1)   // -1 means wait forever
        if(connection != NULL)
           // Here, a new thread is created for each client and data transfer is started
           // The original thread continues to wait for connections
    while(running)
    I don't understand how could this be done with LabView. With the use of local variables,
    I can think of a solution that could process the clients, if the number of clients is known
    at development time.
    Can I somehow create threads with LabView at run-time?
    This whole thread issue in LabView is quite confusing to me, so if someone knows a good
    solution to that TCP server problem, I would really appreciate it. I think that would help me
    understand this matter.
    Thanks.

    The LabVIEW terms you need to understand are VI Server and reentrant execution. There are some great TCP examples that ship with LabVIEW that should help you along...
    Take a look at the vi called examples\viserver\runvi.llb\DateServerUsingReentrantRun.vi
    This examples folder is in your LabVIEW folder (LabVIEW x.x)
    Message Edited by Phillip Brooks on 07-25-2007 08:57 AM
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • TCP SERVER labview CLIENT not labview

    Hi
    I maked a little TCP server with labview like the example with little modification (I read data from serial port...)
    If I use client build with labview I launche client and I read every time data until clint disconnect, if I use a client not build in labview I read only one time not in continue (server doens't write after the first time also if client is connect)
    Can you help me?
    best regards
    elisa
    Attachments:
    Multiple Connections - Servercon Seriale.vi ‏161 KB

    HI,
    Can you explain in detail how you modify your program.
    Can you post your working program for both server and client.
    Hopefully, get a reply from you.
    Thank you,
    Hussin

  • The timesheet creation failed, because of problems with the project I server or with data validation

    Hi,
    One of my user is facing issue in creating new time sheet,
    "The time sheet creation failed, because of problems with the project server or with data validations".
    This issue is coming to only few members out of 10000 members.
    Note: For the same user, can able to do in other machines. only the problem in his machine. Have ran the office diagnostics, but still the problem persists.
    Is any add-on's/any settings need to update in IE. Could any one please help me on how to fix this issue?
    Many thanks in advance.

    I would check the compatibility settings in IE etc, or try another browser (chrome, safari etc.)
    Ben Howard [MVP] | web |
    blog | book

  • How to Connect to TCP Server in AIR?

    I have a TCP server that apparently is working and is listening for incoming connections:
    package
        import flash.display.Sprite;
        import flash.events.EventDispatcher;
        import flash.events.Event;
        import flash.events.*;
        import flash.events.IOErrorEvent;
        import flash.events.ProgressEvent;
        import flash.events.ServerSocketConnectEvent;
        import flash.net.ServerSocket;
        import flash.net.Socket;
        public class TCP extends Sprite
            private var serverSocket:ServerSocket;
            private var clientSockets:Array = new Array();
            public function TCP()
                try
                    // Create the server socket
                    serverSocket = new ServerSocket();
                    // Add the event listener
                    serverSocket.addEventListener( Event.CONNECT, connectHandler );
                    serverSocket.addEventListener( Event.CLOSE, onClose );
                    // Bind to local port 8087
                    serverSocket.bind( 8087, "127.0.0.1" );
                    // Listen for connections
                    serverSocket.listen();
                    trace( "Listening on " + serverSocket.localPort );
                catch(e:SecurityError)
                    trace(e);
            public function connectHandler(event:ServerSocketConnectEvent):void
                //Thesocket is provided by the event object
                var socket:Socket = event.socket as Socket;
                clientSockets.push( socket );
                socket.addEventListener( ProgressEvent.SOCKET_DATA, socketDataHandler);
                socket.addEventListener( Event.CLOSE, onClientClose );
                socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
                //Send a connect message
                socket.writeUTFBytes("Connected");
                socket.flush();
                trace( "Sending connect message" );
            public function socketDataHandler(event:ProgressEvent):void
                var socket:Socket = event.target as Socket
                //Read the message from the socket
                var message:String = socket.readUTFBytes( socket.bytesAvailable );
                trace( "Received: " + message);
                // Echo the received message back to the sender
                message = "Echo -- " + message;
                socket.writeUTFBytes( message );
                socket.flush();
                trace( "Sending: " + message );
            private function onClientClose( event:Event ):void
                trace( "Connection to client closed." );
                //Should also remove from clientSockets array...
            private function onIOError( errorEvent:IOErrorEvent ):void
                trace( "IOError: " + errorEvent.text );
            private function onClose( event:Event ):void
                trace( "Server socket closed by OS." );
    But how do I connect to it? I'm trying to make a multiplayer game, and I want variables and strings to be communicated to each client, but what code do I have to put in to get one of the  clients to connect to the other? Again, it successfully LISTENS for a connection, but I don't know how to get anything to connect to it. Another thing is that I get an error thrown at me when I try to test the standalone SWF file, it only listens for connections when I hit "test movie" in the FLA... Thanks in advance...

    Well, i don't know how to detect your ps3 on your imac, but i know a way to connect your PS3 to you imac and Macbook, it's called Remote Play, this was created by sony some years ago, read this article for more: http://www.tech-recipes.com/rx/7225/playstation-3-use-remote-play-on-any-non-son y-vaio-windows-7-pc-ps3-firmware-3-30/

Maybe you are looking for

  • Every time I try and add a Title to my movie project, iMovie crashes!

    Every time I try and add a title to my movie project, iMovie crashes!  I am running Snow Leopard and iMovie '09 (version 8.0.6).  I haven't used iMovie in a couple of months,  but can't imagine why that would make a difference.  This issue happens wi

  • File Sender adapter - source file name - weird

    Hi all, We have a sender file adapter polling an ftp location. The Dynamic config has been enabled to get the source file name. The actual file name is - "hrmd.xml", but in the dynamic configuration node, in sxmb_moni, the fileName is shown as ./hrmd

  • Is this new charger going to hurt my phone or can I keep using it?

    I just got a new charger for my phone. Now whenever I plug in my phone now I get the message "This cableor accessory is not certified and may not work reliably with this iPhone". Is this new charger going to hurt my phone or can I keep using it

  • Find Person-ID with the same Name

    Dear all, we are looking for an SAP Report to find out, which Person-ID has the same Name and Birthdate. We Transfer Persons from many Systems and cross Country. So it is possible that an employee has more than one Person-ID. Now we are looking for a

  • Watches email notification

    I am watching some threads and I have set Email Notification. But often no mail is sent to me when thread has changed. (Sometimes it is...) I think email notification doesn't work properly...