Dave wrote:
3) In my App, a Server is only allowed to Accept connections from
Certain Clients (this is controlled by the IP Address and a Value
passed to the Server in the Connection Request). This is my Accept code:
function IStartServer theServerPortNumber
--
-- Accept Connection(s) from Client(s)
--
accept connections on theServerPortNumber with message
"ISMServerContactedByClient"
return empty
end IStartServer
on ServerContactedByClient theIPAddress
local myResult
--
-- Check for Error
--
put the result into myResult
if myResult <> empty then exit ServerContactedByClient
read from socket theIPAddress for kPacketCountSize chars with
message "ISMServerReceivedPacketSize"
end ServerContactedByClient
Can I just look up "theIPAddress" in "ServerContactedByClient" and if
it's not in the list of valid Clients, do do an "exit
ServerContactedByClient" to ignore the request?
That would kind of work, because you neither read from, nor write to,
the socket, so the connection isn't 'active'. However, the connection
will still be open, so you really ought to do "close theIPAddress"
(btw, I think the documentation is misleading. It says the parameter to
the handler called when the connection is open contains the IP Address,
when in fact it contains the socket descriptor - typically an IP Address
and port, but sometimes IP Addr + port + connectionID. I find it
confusing to name that parameter "theIPAddress"; I always call it
pSocket :-).
Also, I'm curious.This is probably just because you've snipped code to
send it here, but just in case it isn't ....
you look at "the result" immediately - what do you expect it to contain
at that point ?
--
Alex Tweedly mailto:[EMAIL PROTECTED] www.tweedly.net
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution