Jump to content

tcpsend?


n9mfk9
 Share

Recommended Posts

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

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...