n9mfk9 Posted October 15, 2006 Posted October 15, 2006 Hello all I like to known how to use tcpsend on a tcplisten to send data as soon a someone connects here is the code i started with i can not get tcpsennd to work ;SERVER!! Start Me First !!!!!!!!!!!!!!! $g_IP = "127.0.0.1" $data ="123" $nport = "23" ; Start The TCP Services ;============================================== TCPStartUp() ; Create a Listening "SOCKET" ;============================================== $MainSocket = TCPListen($g_IP, $nport, 100 ) If $MainSocket = -1 Then Exit ; look for client connection ;-------------------- While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then ;TCPConnect( $g_IP, 23 ) ;TCPSend($MainSocket,$data) msgbox(0,"","my server - Client Connected") ;Exit EndIf Wend $socket= TCPConnect( $g_IP, $nport) TCPSend($socket,$data
n9mfk9 Posted October 15, 2006 Author Posted October 15, 2006 i use a peace of telnet software i try to make a loopback test so i wet to script to send data to port 23
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now