n9mfk9 Posted October 15, 2006 Share 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 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted October 15, 2006 Share Posted October 15, 2006 connects to what Link to comment Share on other sites More sharing options...
n9mfk9 Posted October 15, 2006 Author Share 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 Link to comment Share on other sites More sharing options...
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