Socket/Packet

Discussion in 'PHP' started by anna.sobiepanek, Jul 26, 2007.

  1. #1
    I need to set up one way communication where i receive data packets on my local computer - localhost.
    I have a machine with a serial port, the serial port is connected to a device that creates a virtual ethernet link.
    Basically I have an ip and a port.
    I want to make an application that will open a connection to this port and keep it open for as long as the application is running.
    I want to listen and store any data that is received.
    The machine will send me data (ASCII) automatically.
    I have a winmonitor application that works however i cannot use it to store and manipulate the data or packets that are sent.
    Please help:
    I have tried to create a socket, bind, and connect however it doesn't connect because the machine doesn't respond.... I don't think i can make the machine respond....The technician for that machine doesn't really know.

    Even pseudo code can help if you have any suggestions

    Thnx
     
    anna.sobiepanek, Jul 26, 2007 IP
  2. wmbetts

    wmbetts Peon

    Messages:
    27
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't think PHP will do serial connection (which from what your telling me is what you want). Look at C# if you're in windows.
     
    wmbetts, Jul 26, 2007 IP
  3. Tarkan

    Tarkan Peon

    Messages:
    491
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    with PHP you can use fsockopen and do a little research at php.net on sockets. However if you want to do it the best way I recommend using C++ programming.
    Do not use the crap known as C#.
     
    Tarkan, Jul 27, 2007 IP