Nova Posted April 5, 2005 Share Posted April 5, 2005 Has anyone created a server which adcepts multiple clients using larry au3xtra.dll ? A few months ago I was playing with the new Tcp function's Larry's DLL offered and altho I created quite a few client/server gui's I could never manage to get more than 1 client to connect to a server ! Ive been really busy latly and havnt been around much, but once again my intrest has been sparked by the idea of creating a multi client server ! I wish to make a handy network tool! Has anyone got an sample code demonistrating a server that adcepts more than one client ??? that they would like to share ??? Link to comment Share on other sites More sharing options...
Crome_BAD Posted April 5, 2005 Share Posted April 5, 2005 I had one laying around. We lost power one night so i decided to mess with it on my laptop:P I tested it the next day and it worked fine on a network. Ill see if i can find it laying around. Crome Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 6, 2005 Share Posted April 6, 2005 where'd my post go? i posted a server 3+ hours ago.... well here it is the server doesn't forward messages to all clients or send anything but its here expandcollapse popup#include <GUIConstants.au3> DllCall("au3xtra.dll", "int", "TCPStartUp") $MainSocket = DllCall("au3xtra.dll", "int", "TCPListen", "str", "127.0.0.1", "int", 81, "int", 100) If @error = 1 Then Error() $MainSocket = $MainSocket[0] Dim $Userlist Dim $socket[1] $socket[0] = 0 GUICreate("Server", 300, 300) $Edit = GUICtrlCreateEdit(@TAB & @TAB & "Server started." & @CRLF, 0, 0, 300, 300) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop For $i = 1 To $socket[0] $ret = DllCall("au3xtra.dll", "int", "TCPRecv", "int", $socket[$i], "str", "", "int", 500) If $ret[0] > 0 Then GUICtrlSetData($Edit, GUICtrlRead($Edit) & @CRLF & $ret[2]) EndIf Next $NewClient = DllCall("au3xtra.dll", "int", "TCPAccept", "int", $MainSocket) If Not @error And $NewClient[0] > 0 Then ReDim $socket[UBound($socket) + 1] $socket[0] = UBound($socket) - 1 $socket[UBound($socket) - 1] = $NewClient[0] GUICtrlSetData($Edit, GUICtrlRead($Edit) & @CRLF & "New client.") EndIf WEnd For $i = 1 To $socket[0] DllCall( "au3xtra.dll", "int", "TCPCloseSocket", "int", $socket[$i]) Next DllCall( "au3xtra.dll", "int", "TCPCloseSocket", "int", $MainSocket) DllCall( "au3xtra.dll", "int", "TCPShutDown") Func Error() MsgBox(16, "Error", "Cannot start server.") Exit EndFunc [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
Nova Posted April 6, 2005 Author Share Posted April 6, 2005 Tnx a million for your reply Xenogis, Thats adsactly what I was looking for !!! Im gona have fun editing this code to suit my needs ! You have given me a great start Tnx again, Nova 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