Reply to Re: Ping+Port Routine?

Your name:

Reply:


Posted by Jerry Stuckle on 09/26/05 21:11

Adam wrote:
> On Mon, 26 Sep 2005 06:59:08 -0500, Jerry Stuckle wrote:
>
>>
>>Let's back up a little. I'm wondering if we're looking at the wrong
>>problem.
>>
>>A couple of thoughts here. First of all, where are you running the
>>sniffer? Is it on this machine, or somewhere upstream?
>
>
> I've got Ethereal running on both machines:
>
> 1) Client: Linux - running the PHP script. No firewall.
> 2) Server: WinXP - running the sim in multiplayer mode. Firewall in
> place (Norton PFW) but this server connects OK to other XP machines
> running the sim in client mode.
>

OK, since your client doesn't have a firewall, this shouldn't be a
problem. The reason I asked - if you have a firewall running on the
client, the packets may arrive at the client (and you might see them
with Ethereal), but they may be stopped before they get to the program.

>
>>Also, are you using a firewall or a router anyplace? If so, are they
>>set up properly to pass the incoming data onto your program?
>
>
> The router only sits between the network and the ADSL.
>
> Anyway - I can *see* the packets leaving/arriving on each machine - so
> I think the firewall thing is OK. The packets appear addressed
> properly, and contain data.
>

OK, as long as you can see the packets arriving at the client machine,
you should be OK. I was afraid you might be monitoring them on some
upstream system.

> Having done a fair bit of googling around, it seems PHP's sockets
> implementation is a bit quirky. All sorts of oddities come into the
> equation - the "magic_quotes" setting, stream_set_blocking and so on.
>
> I could paste the dumps of each packet if that helps any.
>
> Over to you, Mastah! <g>.
>
> Adam.


I don't think the packet dumps will help any more than we already have.

As for the blocking mode - fsockopen() defaults to blocking mode, so the
fread() should block until some data comes in. And if the data do
arrive before you issue fread() (unlikely), the system should buffer it
until you issue fread().

However, this brings up another question. Does the fread() return
immediately, or is there a delay before it returns? I'm wondering if
it's possible that you are timing out on the fread() request. I'm not
sure what the default timeout value is (timeout on the fsockopen only
applies to making the connection) but you can use stream_set_timeout()
to set it to a longer value.

I really wish I could be more help here - but this is a problem I
haven't run into before.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация