User Tag List

Results 1 to 8 of 8

Thread: Streamlining MooSock > PHP Transfer Time

  1. #1
    No Products Registered

    Join Date
    May 2007
    Location
    Chicago, IL USA
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Streamlining MooSock > PHP Transfer Time

    I am presently using the "Online Scoreboard Tutorial" written by DavidN. Many should be familiar with it.
    When running my php file through a regular web browser, it takes less than one second to display any given query/echo.
    But when I run PhP >MooSock > MMF2 it takes approx. 4 secs. for data transfer. Here is what i know:

    MooSock Commands
    ================================
    SendTextLine "GET http://www.website.com/submitscore.php?name="+Edittext$( "Name Box" )+"&score="+Str$(value( "Counter" ))

    Tried replacing the SendTextLine w/ SendText, but when you go to recievetext, it requires a value?

    The SendTextLine Command above, which works, has a few other SendTextLine commands that come along with, that seem to be dependant upon the proccess working, yet seem meaningless?

    sendtextline"From: clicktutorial@nowhere.com"
    sendtextline"User-Agent: HTTPTool/1.0"
    sendtextline""
    Listen Port 80

    I am also aware that these command have been told to connect when event button is pressed. So I tried connecting at start of frame, and doing transmission on event. Still approx 4 sec transfer time.

    [b]1. How can I reduce transfer times?

    2. Is it the connection that is the slow part of the proccess?

    3. Can a connection be open all frame, and transmit faster onced already opened? Tried that and didn't seem to work. Any necessary changes?

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    The value in receive text is a (max) number of characters to receive. It has the advantage that it actually receives the blank line between the response headers and the response data, but you have to split it into lines yourself if you need lines.

    EDIT: Receive text is also faster than receive text line.

    You can keep a connection open after a request by giving the "Connection: keep-alive" header. You can then make more requests in the same connection later. If you leave it too long or the server doesn't support it it will close the connection on you, so don't rely on it.

  3. #3
    No Products Registered

    Join Date
    May 2007
    Location
    Chicago, IL USA
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    Spike,

    Appreciate the attention to detail.
    I am using a http server using php.

    Have collected a few clues, which led me to believe it was the sendtextline and/or the blocking mode that is causing the waiting.

    Here is what I am still left wondering:

    1. Does sendtext function (under MooSock commands) write over one another....as in....will one sendtext put the next sendtext data in correct order? need information going into sql to still fill out 'id','name','score' & 'dateuploaded'...as long as this function will still transmit data...does it?

    2. Where is blocking mode setup? within http server? or mmf2?

    3. Within event editor (under MooSock commands) already have a sendtextline""....are you proposing I leave this sendtextline"" with all sendtext commands, or is this a change within php code?

    4. Using the sendtext method should require a recievetext command as well, right? what is a proper value to grab all four field input data?

    Hope its not to confusing.
    Numbered the questions for easy feedback if anybody has an answer to only one or a few. The more the better.

  4. #4
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    END. Blank line at the end.

    Basically if you're using receive line and your page ends with a line that doesn't have a newline symbol at the end, then it has to timeout before it'll give you the last line.

    EDIT:
    Q1. Does sendtext function (under MooSock commands) write over one another....as in....will one sendtext put the next sendtext data in correct order? need information going into sql to still fill out 'id','name','score' & 'dateuploaded'...as long as this function will still transmit data...does it?
    A1. Yes, Moosock is based on tcp, it's guaranteed to arrive in the order you sent it.

    Q2. Where is blocking mode setup? within http server? or mmf2?
    A2. In the properties of the moosock object in MMF.

    Q3. Within event editor (under MooSock commands) already have a sendtextline""....are you proposing I leave this sendtextline"" with all sendtext commands, or is this a change within php code?
    A3. The send lines make no real difference, sendtext(""+newlione$) is identical to sendtextline("")

    Q4. Using the sendtext method should require a recievetext command as well, right? what is a proper value to grab all four field input data?
    A4. It makes no difference, except that receivetextline is slower and receivetext needs you to split up the lines yourself. You don't have to match send text with receive text.

  5. #5
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro

    Join Date
    Jun 2006
    Location
    France
    Posts
    1,266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    You can use the download object isntead. Just make sure your PHP script serves the file as file and not as webpage. This can be done by changing the header to "force download". I tested with my own scripts, and the download object can be up to 10 times faster then MooSock!!

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    2,023
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    i will repost this as someone felt the need to remove it:
    "END. Blank line at the end."
    Thanks for paying attention

  7. #7
    No Products Registered

    Join Date
    May 2007
    Location
    Chicago, IL USA
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    Patrick,

    This is an alternate method I am looking to explore and compare.
    When you mentioned "header", did you mean within php or mmf2? what tags?

    And I also realized within demo there is no download object, is this in full version?

  8. #8
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Streamlining MooSock > PHP Transfer Time

    Quote Originally Posted by Machina12
    And I also realized within demo there is no download object, is this in full version?
    Yes, it was released with Build #243. Clickteam has added plenty of new features through the free updates. For example, in Build #244 there is OR functionality, meaning you can make an event run if one set of conditions is true *or* if another set of conditions is true.
    .:::.Joshtek.:::.

Similar Threads

  1. Moosock Transfer Files problem
    By Dagge in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th July 2010, 10:03 PM
  2. Server => Client : File transfer using MooSock
    By Rushino in forum File Archive
    Replies: 11
    Last Post: 10th January 2007, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •