NMS Posted February 20, 2021 Share Posted February 20, 2021 Hello, I've been trying to use this API https://vndb.org/d11 however due it using the TCP connection I'm having issues getting any response back as I've never dealt with TCP. #include <MsgBoxConstants.au3> Local $Port = 19534 Local $Server = '51.15.19.21' TCPStartup() OnAutoItExitRegister("OnAutoItExit") Global $Socket = TCPConnect($Server, $Port) If $Socket = -1 Then Exit MsgBox(16, 'Error', 'Connection error.') TCPSend($Socket, 'login {"protocol":1,"client":"test","clientver":"0.1"}0x04') ;TCPSend($Socket, 'dbstats0x04') While 1 $Data = TCPRecv($Socket, 512) If $Data <> '' Then MsgBox(0, 'Received:', $Data) TCPCloseSocket($Socket) EndIf Sleep(50) WEnd Func OnAutoItExit() TCPShutdown() EndFunc I'm fairly certain there's nothing wrong with the code, I've looked up multiple examples on the forums from other users and no matter how I try and send the data I simply am not getting any response. Perhaps I'm missing something from the documentation of the API itself but I can't quite figure out what. Link to comment Share on other sites More sharing options...
Nine Posted February 20, 2021 Share Posted February 20, 2021 Made it worked with this line : Local $iRet = TCPSend($Socket, 'login {"protocol":1,"client":"test","clientver":"0.1"}' & chr(4)) NMS 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
NMS Posted February 20, 2021 Author Share Posted February 20, 2021 Now I feel dumb for not trying the EOT character... Thank you! 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