Search the Community
Showing results for tags 'sockets'.
Found 3 results
tarretarretarre posted a topic in AutoIt Example ScriptsAutoIt-SocketIo Yep yep, this is pretty much an attempt to port the existing project's concept https://socket.io/ to AutoIt's Codebase. So i will not go in to so much detail. This is how the communication is done http://i.imgur.com/0mMfsBD.png Each client is isolated to the server http://i.imgur.com/rVO2LFb.png Features Easy API VarType Translation (Example: If the server sends an int, the client will receive an int and vice versa) Fully featured examples Data encryption (Using Autoit's UDF Crypt.au3) Limitations / Drawbacks Every Broadcast/Emit is limited to a maximum of 16 parameters Every Callback Function has to have the same number of parameters as the Broadcasted/Emited event It is not possible to Broadcast/Emit objects Only 1D-arrays are allowed to be Broadcasted/Emitted (2D arrays will probably never be supported) Changelog Version 1.1.0 (This update DOES NOT break scripts) Fixed bug when Emitting / Broadcasting without any parameters causing a $fCallback crash Optimized Package-handling once again. Added 1D-Array support (Endless nestning). Added Subscriptions (See _Io_Subscribe _Io_Unsubscribe and _Io_BroadcastToRoom). Added new example for subscriptions (Be sure to use different room names when joining with clients) Added Unit testing (See Tests\Runner.au3 and Tests\Tests.au3, to run tests you need a udf found here: https://github.com/tarreislam/Autoit-Unit-Tester) Version 1.0.0 (This update DOES NOT break scripts) Added data encryption (Using Autoit's UDF Crypt.au3) See more at _Io_EnableEncryption Added new method _Io_Disconnect which can be used with both servers and clients Improved package-handling to increase performance Increased the limit of Broadcasted/Emit parameters from 10 to 16 Api methods Server methods _Io_Listen($iPort, $iAddress = @IPAddress1, $iMaxPendingConnections = Default, $iMaxDeadSocketsBeforeTidy = 1000) _Io_Subscribe(ByRef $socket, $sRoomName) _Io_Unsubscribe(ByRef $socket, $sRoomName = null) _Io_Broadcast(ByRef $socket, $sEventName, $p1, $p2, ...$p16) _Io_BroadcastToAll(ByRef $socket, $sEventName, $p1, $p2, ...$p16) _Io_BroadcastToRoom(ByRef $socket, $sDesiredRoomName, $sEventName, $p1, $p2, ...$p16) _Io_socketGetProperty(ByRef $socket, $sProp = Default) _Io_getSocketsCount() _Io_getDeadSocketCount() Client methods _Io_Connect($iAddress, $iPort, $bAutoReconnect = False) _Io_Reconnect(ByRef $socket) Server and Client methods _Io_getVer() _Io_On(Const $sEventName, Const $fCallback) _Io_Emit(ByRef $socket, $sEventName, $p1, $p2, ...$p16) _Io_Loop(ByRef $socket) _Io_LoopFacade() _Io_EnableEncryption($sFileOrKey, $CryptAlgId = $CALG_AES_256) _Io_Disconnect() Default events Server events connection Server and Client events disconnect View source on github Autoit-Socket-IO-1.0.0.zip (OLD!) Autoit-Socket-IO-1.1.0.zip
So here's what I'm trying to accomplish: I need the ability to restart an application on my desktop PC from within my home network. Obviously, writing a script to do that locally would take all of ten seconds. The trick is that I want to do it remotely. I still feel like it wouldn't be difficult to accomplish with a server/client script. But of course, that's not good enough. I want to do it from my iPhone. And the easiest way I can see to accomplish that would be through the browser. So in my mind, I'm thinking that, on the server side, I can listen for connections on, let's say port 8080. I can watch for a "GET / HTTP/1.1" (or whatever it is...) and respond with a simple webpage that reports a status and has a reset button. On my phone, I type, say 192.168.1.150:8080 and get that simple page. When I click the reset button, it sends a "GET /?reset=true" or something and that will trigger a function in the server script to reset the app. So in essence, this would be a very simple web server, one that only serves a single, hardcoded page. But this seems too simple. Is it? Or is it actually way more complicated than that?
Hello everyone, recently (you could call it a day before yesterday), I made a robot (connected to my PC) which I could control using WinSock. This is fairly easy in C++, but could anyone please guide me how to write the function WSASetService (an example is greatly appreciated) in AU3. All I have done so far is this: Func _WSASetService() $WSAQUERYSET = DllStructCreate("dword;wstr;word") ;incomplete structure $RESULT = DllCall($hWs2_32, "int", "WSASetServiceW", "struct", $WSAQUERYSET, "int", 0, "Dword", 0) EndFunc I have no idea for typedefs really. By the way, could anyone tell me how do I search for proper typedefs in the header files of Windows SDK. Thanks... MKISH