Hi All,

I am using Sockets to communicate between Applications. In this example, one Application is a "Server" and the other is a "Client". The Server issues a connected command and specifies a Callback handler as so:

accept connections on theServerPortNumber with message "ServerContactedByClient"

on ServerContactedByClient theIPAddress
  local myClientIPAddress
  local myResult

  put the result into myResult

  if myResult <> empty then
    breakpoint
    exit ServerContactedByClient
  end if

  set the itemDelimiter to ":"
  put item 1 of theIPAddress into myClientIPAddress

if myClientIPAddress is not among the lines of sgServerClientAllowList then
    close socket theIPAddress
  end if

read from socket theIPAddress for 8 chars with message "ServerReceivedPacketSize"

end ServerContactedByClient

I am testing the error handling when a Client tries to connect but that server doesn't allow it to connect. The "ServerContactedByClient" gets called and the IP address is NOT is present in the "sgServerClientAllowList" (a Script Global), so the close socket is executed. However on the Client I have the following code:

  open socket mySocketAddress with message "ClientSocketOpen"


on ClientSocketOpen theIPAddress
  local myConnectString
  local myConnectionID
  local myResult


  put the result into myResult
  if myResult <> empty then
    breakpoint
    exit ClientSocketOpen
  end if

  --
  --  Send the Connect Message, Start with the Count
  --
  put "Connect," & myConnectionID into myConnectString
write myConnectString to socket theIPAddress with message "ClientSocketConnectionDataSent"
end ClientSocketOpen

The "ClientSocketOpen" handler is called but the "ClientSocketConnectionDataSent" handler is never called, as I would expect, since the Server closed the Socket, however, the socketError or sockTimeout handler are not called either?

My question is, how can the Client tell if the connection has been successful or not?

Thanks a lot
All the Best
Dave

















_______________________________________________
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

Reply via email to