IP conflict?
Nicolas Cueto
nicolas_cueto at yahoo.com
Sun Jun 26 17:52:49 EDT 2005
Hello All,
Ok, the problem. A request for data
made to a server stack by stacks via
a LAN will on occassion return empty.
Sometimes things work perfectly and
all eight stacks will receive the data. But
when at times one or two of the stacks
do not receive the requested data, the
user must restart their stack, which
"solution" always works.
My guess is that the incoming requests for
data may be overwhelming the server, and
creating a bottleneck of sorts. In which case,
what might be a solution?
If it helps, below are the relevant script
portions from both the server and the host
stacks, in the order they are triggered.
As always, thank you in advance,
Nicolas Cueto
//////////////////////////////
## 1. THE DATA-REQUEST SCRIPT
## ON A LOCAL STACK
on mouseUp
put "192.168.1.11:8025|" & gLocalStackID & "Two" into tSocket
open socket to tSocket with message "VSenditTwo"
wait 1 second with messages
end mouseUp
on VsenditTwo v
put "DataKudasai!" & return into tdata
put gLocalIP & return & gUserID & return after tdata
put ")(*&^%$#@!" after tdata
write tdata to socket v
close socket v
end VsenditTwo
##2. THE DATA-REQUEST RECEIVED
##AND DATA-TO-BE-SENT SCRIPTS
##ON THE SERVER STACK
on netConnectOne incomingMessageOne
read from socket incomingMessageOne until ")(*&^%$#@!"
delete the last line of it
put return after it
put it into receivedData
close socket incomingMessageOne
if "DataKudasai!" is in receivedData then
put line 3 of receivedData into tUserID
put line 2 of receivedData into tHostIP
loadConcentrationData -- READ DATA FROM LOCAL FILE
wait 1 second with messages
put tData & return & "kagiNoBunOwari" & return into tDataDesu
put tDataDesu into tOutMessageTwelve
put "DataDesu" into tOutMessageTypeTwelve
put tHostIP & ":8080|ServTwelve" into tHostPath
open socket to tHostPath with message "sendItTwelve"
end if
end netConnectOne
on sendItTwelve sTwelve
put tOutMessageTypeTwelve & "!" & return into tdata
put tOutMessageTwelve & return after tdata
put ")(*&^%$#@!" after tdata
write tdata to socket sTwelve
close socket sTwelve
end sendItTwelve
##3. THE DATA-RECEIVED SCRIPT
##ON THE LOCAL STACK
on netConnectOne incomingMessageOne
put empty into tRawReceivedDataOne
repeat -- FIGURE MESSAGE LENGTH
read from socket incomingMessageOne for 100 lines
put it after tTempIncoming
if ")(*&^%$#@!" is among the lines of tTempIncoming then exit repeat
end repeat
put tTempIncoming into it
delete the last line of it
put return after it
put it into receivedData
close socket incomingMessageOne
if "DataDesu!" is in receivedData then
put receivedData into tRawReceivedDataTwo
processReceivedDataTwo
end if
end netConnectOne
//////////////////////////////
More information about the use-livecode
mailing list