Sign in to follow this  
Followers 0
bluerein

TCPlisten

2 posts in this topic

Having problems listening to a port...

Im running TVersity media streamer on port 41952 on ip 192.168.0.3 , problem is the cpu keep sleeping whilst streaming

so basically all im trying to do is check the port to see if its active or not ..

tried

$g_IP = @IPAddress1 ; 192.168.0.3 -ip of server

; Start The TCP Services
;==============================================
TCPStartUp()

; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPConnect($g_IP, 41952)
If $MainSocket = -1 Then
    msgbox(16,"",@error)
Else
    msgbox(16,"","success!!")
Endif

which should of worked but returns an error of "10013"

tried TCPconnect and that worked ok

$g_IP = @IPAddress1 ; 192.168.0.3 -ip of server

; Start The TCP Services
;==============================================
TCPStartUp()

; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPConnect($g_IP, 41952)
If $MainSocket = -1 Then
    msgbox(16,"","error")
Else
    msgbox(16,"","success!!")
Endif

but this doesnt help me as the servers running 24/7 so the connection as always there

Any ideas or a better way to do it??

Cheers

Share this post


Link to post
Share on other sites



Try opening a command line console and use NETSTAT. You're looking for a connection status of ESTABLISHED. Check it when there is an active connection, and when there isn't to see if you can tell from there.

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  
Followers 0