Jump to content

Recommended Posts

Hey guys, ive been workin on this little server/client gui based thing, and the code from Larry:

;EXAMPLE SERVER CODE using AU3Xtra.DLL
;======================================

Global $WSABASEERR = 10000
Global $socket = 0
Global $str = ""


;Start the TCP abilities
;-----------------------
$x = DLLCall( "AU3Xtra.dll", "int", "TCPStartUp" )
If @error Or $x[0] = 0 Then Exit


;Wait for a connection
;-----------------------
$x = DLLCall( "AU3Xtra.dll", "int", "TCPListen",_
             "str", "127.0.0.1",_
             "int", 65432 )
If @error Then CleanUp(0)
$socket = $x[0]


;Wait to receive data. Loop until "quit" or "" is received,
;                     or disconnection.
;---------------------------------------------------------
Do
  $x = DLLCall( "AU3Xtra.dll", "int", "TCPRecv",_
                               "int", $socket,_
                               "str", "",_
                               "int", 1024 )
  $err = @error
  If Not $err Then
     If $x[0] >= $WSABASEERR Then ExitLoop
     $err = Process($x[2])
  EndIf
Until $err


;CleanUp() is a wrapper for TCPShutDown
;--------------------------------------
CleanUp($socket)


;FUNCs
;++++++++++++++++++++++++++++++++++++++

Func CleanUp($CU_SOCKET)
  DLLCall( "AU3Xtra.dll", "int", "TCPShutDown",_
                        "int", $CU_SOCKET)
  Exit
EndFunc

Func Process($szMsg)
  If $szMsg == "quit" Or $szMsg == "" Then Return 1
  $str = $str & $szMsg & @LF
  ToolTip(StringTrimRight($str,1))
  Return 0
EndFunc

Locks up my Win ME and XP cp, i havent tried it on 98SE yet, but i will if i havta:P

If any1 has an answer, Plz Help

Peace,

Crome_BAD

Link to post
Share on other sites

Alright ty alot, ill do sum testing to, im on my stepdads laptop. He got a virus and it killed his MS-Dos prompt, so i cant tell if it actually works, unless i create a label that shows AFTER it connects. I keep getting now is its unable to start tcp abilities. Anyone kno how to repair msdos? lol command.com....or cmd.com

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...