A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 40 of 40

Thread: SUPER ADVANCED XML QUESTION!

  1. #21
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    You have placed the server on an external IP??

  2. #22
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    How do i place it on a external ip? I only have 2 computers... and both of them are behind my router...


  3. #23
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    you mean like unplugging my router and connecting my computer straight to the cable box? That way my computer will have it's own ip address.

    If that's what you meant, that won't work for me. I need both of my computers connected to the router so I can share files and the internet.

  4. #24
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    That's what I'd try. Then you could narrow it down to a problem with internal/external IPs.

    I promise you it CAN work - but there's so many variables...

    If you want you can email me the FLA, and I'll try to get it put up on the server that I have set up exactly like yours.. then you can see that it works. (I'm not sure how long it would take me to get it on that server.. I'm not sure if I remember the IP... )

  5. #25
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    Hey that would be great if you could test them out for me....

    I'll send you the fla to your email account. I'll warn you know it's not much to look at right now .

    I am not sure if you want the java server I am using. I'll send it to you anyways...

    Thanx so much for everything.... I've spent so many days on this I'd love to see it finally working....


  6. #26
    His Flashy Highness
    Join Date
    Aug 2001
    Location
    SF Bay area
    Posts
    56
    Juggle5, I also noticed on the router configuration there is a "Special Application" tab. Could that be something I should use? It looks like more port forwarding.
    .. but i don't know..
    First of all I should mention that I'm not an expert in routers and firewalls at all... I'm just dabbling here so take all I say with a shovel of salt...

    But I do believe that the "special applications" is not right point to poke around in. I've needed that only a single time so far and that was to set up two-way video conferencing through a web cam.

    I'm still confused about one thing in your problem though: Are you trying to set up a chat between you and somebody outside your firewall or between two machines inside your firewall (because the first post sounded to me a bit like you were trying to do the latter)...?



    About the 'security sandbox': as long as both your java server and your web server have the same IP number (same domain) you should be taken care of.

    But I was surprised / confused that you connected like this (in one of the examples - if I remember that correctly now)

    sock.connect(123.123.123.123:2000, 9999);

    and even something along the lines

    sock.connect("http://123.123.123.123:2000", 9999);

    Something like this works? Are you sure? I thought the first parameter can only be an IP number and then the second one is the port. So what would the port be that is used in this case? 2000 or 9999? If I were Flash I would be confused. I've done a fair amount of XML socket stuff and I always use only an ip number and a port number as second parameter.

    also, when you put an http in there you are saying "use http protocol" but that's something different than a socket connection, right? (http closes after transfer, socket connection stays open)

    You essentially load your .swf from a web server (port 80 or whatever yours runs on - say - 2000) doing something like (embed swf blabla http://123.123.123.123:2000/chat.swf )

    then _inside_ the .swf you have the connection

    sock.connect(123.123.123.123, 9999);

    (well, to be exact, as I have that code just handy in MX...

    <pre>
    var server = "123.123.123.123";
    var port = "9999";
    myXMLSock = new XMLSocket();
    myXMLSock.ignoreWhite = true;
    myXMLSock.onXML = processxml;
    myXMLSock.onClose = closexml;
    myXMLSock.onConnect = connectedXML;
    if (!myXMLSock.connect(server, port)) {
    trace("connection failed");
    } else {
    trace("waiting for connection");
    }
    function connectedXML(success) {
    trace("XML connection successful: " + success);
    }

    function closexml() {
    trace("XML socket closed");
    }

    function processxml(xmldata) {
    trace("got data");
    root = xmldata.firstChild;
    (....)
    }
    </pre>

    Don't forget to use the xmldata you get as parameter in processxml and NOT myXMLSock (that's something I keep doing wrong every single time and then it takes me an hour each time why "I don't get any data out of my connection")

    Sorry to belabor these - maybe obvious - points, but your way of connection looks so different from what worked for me... so maybe give this a shot too -- cannot hurt at this point, right?

    Good luck,

    Juggle5





  7. #27
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    Ok, Juggle5... Answers to your questions...

    I'm still confused about one thing in your problem though: Are you trying to set up a chat between you and somebody outside your firewall or between two machines inside your firewall (because the first post sounded to me a bit like you were trying to do the latter)...?
    I am trying to set up a chat between 2 people outsied my firewall. If I try and set up a chat between 2 people inside my firewall (well, my computer to my computer) it works fine (assuming I use "localhost" as the address). So ya, I want it so that 2 people can go to my website and chat.

    But I was surprised / confused that you connected like this (in one of the examples - if I remember that correctly now)

    sock.connect(123.123.123.123:2000, 9999);
    ok... I am not expert here either... but when you use the example above, the port 2000 is the port number that flash tried to enter the ip at. And the 9999 is the port that it tries to find a service running on.

    You were saying you think it would be confused... but if you just use this ip instsead : 123.123.123.123 (without specifing a port number) it still automattically assumes port 80 (the http port). So, by setting it to 2000 you just override the port 80. And just to clarify, I do not sue port 80 because my other computer I have (on the same router alos has a webserver running... and It uses port 80.

    also, when you put an http in there you are saying "use http protocol" but that's something different than a socket connection, right? (http closes after transfer, socket connection stays open)
    Hmm... good point. I never thought of that at all. I'll give that a try and keep you posted.

    As for the code you gave... I "think" my code is almost identical to it... with execption to the fact that i used "http://".

    Either way I'll be spending all day today (again) trying to figure out what is wrong with this.

    Thanx again everyone for your help. I realize you have much better things to do than help me




  8. #28
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    VAYKENT said something about placing the java server elsewhere... somewhere off of your LAN. i think that is a very good idea. how about trying that?

  9. #29
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    yea, i didnt realize that there were two pages on the post.. hence my retarded post above =D sorry.

  10. #30
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    ya... i'll try removing my router from the situation in about 30 minutes or so... just to try and narrow down the problem

    but first.... I tried what you had said... I removed the "http://" from the connect line and it did something different. This time, the swf actually ran the actionscript "server.onConnect".

    Normally, whenever I try and get the swf to connect to the server... it never calls the function "server.onConnect". It just waits there forever.

    But now it actually called the function and printed out my message saying connection failed. What decides if the "server.onConnect" function gets called? Obviously everytime I have ever tested the chatroom, it has never connected, and thus I would have thought it would always call the "server.onConnect" with arguments saying it failed.

    I hope that made soem sence at all. I am tired and can type. More or less, why did it only call the function saying the connection failed after I removed the "http://" from the connect line?

    Does that mean it actually reached the server and just could connect? And all the other times it just never made it there at all...?


  11. #31
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    YES!!!!!!!!!!!!!!!!!!!!!

    It finally works!!!

    Here's what I did (thanx to all of you) to get it working.

    Like Juggle5 suggested, I removed the "http://" from the connect line in the actionscript. Then all I ddi was use this to connect:

    server.connect("123.123.123.123",9999);

    where 123.123.123.123 is my routers ip
    and 9999 is the port that the java server listens on....

    it must have been the "http://" part for soem reason....

    either way... thanx so much for all your help!!!

    That would have taken me weeks to solve!!

    -Ryan


  12. #32
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    hey, id like to see your chat room in action... im sure most of us agree, whats the address of the room?

  13. #33
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    ok... before you check it out... make note of a few things:

    1.) The chatroom worked a most of the time. It worked for some of my friend, and not for others (I think because they were at work and behind a firewall)

    2.) The link below is for my website that is very far from being done. There are some things I like about it, and some things I will eventually toss away. Plus allot of the links on it default to the same page (I haven't done those sections yet).

    3.) Most importantly, the chatroom is still in testing phase. I know of some of bugs in it.



    Ok.... just so I get an idea of it is actually working for some people (other than my friends) please post back here saying if it worked for you (or if it didn't work... what happened?)

    Ok... once you click on the link below, go to the section called "chatroom"

    I hope it works for you...

    http://24.71.216.109:1234/website/index2.html

    -Ryan


  14. #34
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    well, i see the site.. very nice might i add. but whenever i click on any of teh buttons (as in all of them) i just see the spinning circles in the middle. am i doing something wrong?

  15. #35
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    hmm... a friend of mine had that problem too... I'll have to look into it.

    You do have flash player 6 ...right?

  16. #36
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    How could I miss the HTTP??

  17. #37
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    Ok... try the link above again.... The buttons hopefull will work... if they don't, please let me know :P

    -Ryan

  18. #38
    Junior Member
    Join Date
    May 2002
    Posts
    3

    Post my friend...

    ::: Quoting ::::::::::::::::::::::::::::::::::::::::::::::::
    Ok, in my previous posts I referred to the IP address of 123.123.123.123 that is actually my router's ip. Then each of my computers connected to the router has it's own internal ip of 192.168.2.x (for example).

    I did try what you suggested. I changed the flash actionscript to connect to my routers ip and port 9999
    :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::


    well my friend, i might have some suggestions for you!


    ---------------------------------------------------
    ROUTER ADDRESS: 123.123.123.123
    ROUTER SUBMASK: 255.255.255.0
    MACHINE with SERVER: 192.168.2.10
    PORT: 6666
    ---------------------------------------------------


    in Windows OS:
    --------------
    1. Goto machine that runs your server
    2. Find your NIC that is connected to router
    3. Change TCP/IP Network properties to MANUAL SETTINGS. (no DHCP for this machine)
    4. Set your IP address (192.168.2.10 for example)
    5. Set SUBNET MASK to 255.255.255.0
    6. Set gateway to ROUTER's address (123.123.123.123)



    in Router's config:
    -------------------
    1. FORWARD --->> IP: 192.168.2.10 PORT:6666
    2. (OPTIONAL: Put the machine running the server in DMZ)



    REBOOT!
    ------------------------------------------------------------
    So... that means, whenever a request to your WAN IP,LocalHost, and such receive a request to be fulfill on the PORT 6666, calls will just be FORWARDED to the right machine.



    REBOOT!
    enjoy!
    cya later!
    REBOOT!

    ...dont forget god damnit! REBOOT!, youre running Windows!

  19. #39
    His Flashy Highness
    Join Date
    Aug 2001
    Location
    SF Bay area
    Posts
    56
    Originally posted by Sparticus007
    YES!!!!!!!!!!!!!!!!!!!!!

    It finally works!!!

    Here's what I did (thanx to all of you) to get it working.

    Like Juggle5 suggested, I removed the "http://" from the connect line in the actionscript. Then all I ddi was use this to connect:
    Woohooo!!!! Way to gooooo!!!

    -Juggle5

  20. #40
    Game Developer
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    292
    ya... thanx again for everything. It's nice to see there are people out there that actually take the time to help people they don't even know

    It's greatly appreciated!

    -Ryan

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center