Sign in to follow this  
Followers 0
n9mfk9

tcpsend?

3 posts in this topic

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

Share this post


Link to post
Share on other sites



connects to what

Share this post


Link to post
Share on other sites

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

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