Jump to content

Tcp/ip Connections


Recommended Posts

I'm writing a utility to control the computers in a Student lab at my school - to be able to do things like shutdown/logoff/reboot all the workstations from the teacher's computer,

I have a function which uses "TCPConnect" to connect to logged-in workstations.

Func SetupConnections()
    ProgressOn("TCP/IP Connection Progress", "Attempting Connections:", "Workstation")
    For $station = 1 to $numStation
        $state = "Connected"
        $i = 100/$numStation * $station
        $IPAddress = "192.168.15." & $station
        $connectedSocket[$station] = TCPConnect($IPAddress, $portAddress)
        If @error Or $connectedSocket[$station] < 1 Then $state = "Failed"
        ProgressSet( $i, "Workstation " & $station & " (" & $IPAddress & ") : " & $state)
    Next
    sleep(500)
    ProgressSet(100 , "Done", "Complete")
    sleep(1000)
    ProgressOff()
EndFunc

1 I want to run a client program on the workstations, so that the workstation is "listening" for a connection, even if nobody is logged in at the workstation. Is this possible? Can I run my client program as a Windows Service?

2 At the moment, if a workstation is not logged in, the function takes less than a second to bring up the "failed" message. However, if a workstation is actually switched off, it takes up to ten seconds before it times out and shows the "failed" message. Is there any way of speeding this up.

Thanks,

Graham

New International School of Thailand

Edited by GrahamT
Link to comment
Share on other sites

Link to comment
Share on other sites

I'm writing a utility to control the computers in a Student lab at my school - to be able to do things like shutdown/logoff/reboot all the workstations from the teacher's computer,

I think you can get all this funcitonality out of the shutdown.exe tool from the Windows resource kit.
Link to comment
Share on other sites

Maybe Ping will help you out.

Try to ping each IP before opening a socket , you can control the timeout for Ping.

This is also good for ARP.

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...