Crome_BAD Posted December 30, 2004 Share Posted December 30, 2004 Hey guys, ive been workin on this little server/client gui based thing, and the code from Larry: expandcollapse popup;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 comment Share on other sites More sharing options...
Crome_BAD Posted December 30, 2004 Author Share Posted December 30, 2004 Thank You for that, i just decided to redo the client code. Is there a way to take the recieved text and instead of having it send to a edit? This is for a AutoIt chat program, just need alittle help with the dll:P Thanks Lar Peace Crome_BAD Link to comment Share on other sites More sharing options...
Crome_BAD Posted December 30, 2004 Author Share Posted December 30, 2004 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 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