kjcdude Posted November 7, 2008 Share Posted November 7, 2008 (edited) Just what i was looking for. Is there anyway to get the clientid on disconnect? using _TCP_Server_ActiveClient() doesn't produce the active client that disconnected. Edited November 7, 2008 by kjcdude Link to comment Share on other sites More sharing options...
Kip Posted November 7, 2008 Author Share Posted November 7, 2008 ID? You mean socket? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Marlo Posted November 7, 2008 Share Posted November 7, 2008 (edited) Just what i was looking for. Is there anyway to get the clientid on disconnect? using _TCP_Server_ActiveClient() doesn't produce the active client that disconnected. I too had this problem. On client disconnect the Disconnect event didnt return a socket (was impossible to tell who had just disconnect) but i found a way to fix this. Open up your tcp.au3 file in scite and look to lines 370, 371, 372 and you will see this: $_TCP_ACTIVESOCKET = $hSocket ; Connection closed Call($_TCP_HSOCKETS[$iSelected][4],$hSocket,$iError) Basicly the script is wiping the socket before sending it to you. So just swap the lines around so it reads: ; Connection closed Call($_TCP_HSOCKETS[$iSelected][4],$hSocket,$iError) $_TCP_ACTIVESOCKET = $hSocket It should then return the disconnected socket Edited November 7, 2008 by Marlo Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
kjcdude Posted November 7, 2008 Share Posted November 7, 2008 (edited) $_TCP_ACTIVESOCKET = $hSocket ; Connection closed Call($_TCP_HSOCKETS[$iSelected][4],$hSocket,$iError) Basicly the script is wiping the socket before sending it to you. So just swap the lines around so it reads: ; Connection closed Call($_TCP_HSOCKETS[$iSelected][4],$hSocket,$iError) $_TCP_ACTIVESOCKET = $hSocket It should then return the disconnected socket Wish i saw this last night. I built a whole system that logs the ids to an ini file then constantly compares the active ones to the ones stored in the ini file. Your way is much simpler. Thanks Edited November 7, 2008 by kjcdude Link to comment Share on other sites More sharing options...
kjcdude Posted November 13, 2008 Share Posted November 13, 2008 Not sure if this is a bug. I've only been able to produce it within a server side receive. When a server receives text from a client "Func Received($iError, $sReceived)" and _TCP_Server_ActiveClient() is called within that func recieve, the active client ID will be displayed as HEX instead of a DEC as seen throughout the rest of the script. I now have a check on all calls for _TCP_Server_ActiveClient() to see if it's a hex or dec and convert it to a dec so that it's uniformed. Link to comment Share on other sites More sharing options...
Yorn Posted November 20, 2008 Share Posted November 20, 2008 Not sure if this is a bug.I've only been able to produce it within a server side receive.When a server receives text from a client "Func Received($iError, $sReceived)" and _TCP_Server_ActiveClient() is called within that func recieve, the active client ID will be displayed as HEX instead of a DEC as seen throughout the rest of the script.I now have a check on all calls for _TCP_Server_ActiveClient() to see if it's a hex or dec and convert it to a dec so that it's uniformed.It'd be nice to see Kip revisit this UDF. It's got a lot of potential, IMHO. But what exactly did you do? Modify the UDF directly? Link to comment Share on other sites More sharing options...
jvanegmond Posted November 21, 2008 Share Posted November 21, 2008 (edited) Hey Kip, what's the license you are releasing this under? I'd like to translate it to another language and use it in a commercial product. Edited November 21, 2008 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Kip Posted November 21, 2008 Author Share Posted November 21, 2008 (edited) Hey Kip, what's the license you are releasing this under?Eeehm..... none? Edited November 21, 2008 by Kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Skrip Posted November 21, 2008 Share Posted November 21, 2008 Hey Kip, what's the license you are releasing this under?I'd like to translate it to another language and use it in a commercial product.Seeing as the post above is 'none'.Just give him credit somewhere for the original code. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
kjcdude Posted November 22, 2008 Share Posted November 22, 2008 It'd be nice to see Kip revisit this UDF. It's got a lot of potential, IMHO. But what exactly did you do? Modify the UDF directly?I was really lazy and just did it on the server side where i needed it. Here's the code where it's checked. $cactive = _TCP_Server_ActiveClient() if StringIsDigit($cactive) = 0 Then $c1 = StringSplit($cactive, "x") $convertedd = Dec($c1[2]) IniWrite($inifile, "Connections", $convertedd, "Not") Else IniWrite($inifile, "Connections", _TCP_Server_ActiveClient(), "Not") EndIf Link to comment Share on other sites More sharing options...
Skrip Posted January 8, 2009 Share Posted January 8, 2009 (edited) _TCP_Client_Send() does not seem to work. I have a client and server setup, and the server is waiting for the information sent by the client, but it never seems to arrive to the server. Why? (I can post script if needed.) Edited January 8, 2009 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Kip Posted January 8, 2009 Author Share Posted January 8, 2009 Does receiving stuff work? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Skrip Posted January 8, 2009 Share Posted January 8, 2009 Yes. I can send from the server to the client. But not the other way around. So I can't tell if the client isn't sending, or the server isn't recieving. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Marlo Posted January 8, 2009 Share Posted January 8, 2009 Pop open telnet and connect to your server and see if the server is working. Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
Skrip Posted January 8, 2009 Share Posted January 8, 2009 (edited) Pop open telnet and connect to your server and see if the server is working.Well, I can connect from the client. The server returns that the client is connected, and the client responds that it is connected. I'll try the telnet when I get home.The server is waiting for Received() to be called, then it will report what was received. But it never seems to get called. I'll check the the telnet thing when I get home.EDIT: I forgot...I'm on vista. I don't have telnet. I did attempt to connect through Firefox. It was able to connect.If anybody needs the client or server code, I'll be happy to PM it to them. Edited January 8, 2009 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Skrip Posted January 9, 2009 Share Posted January 9, 2009 (edited) Bump. Please help. This issue is pissing me off. Client does not send to server. Or server is not receiving. EDIT: Code removed. Edited January 9, 2009 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Kip Posted January 9, 2009 Author Share Posted January 9, 2009 (edited) Hmm, I made some very big mistakes. I think I'll have to rewrite the whole UDF Sorry for that. Edited January 9, 2009 by Kip MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Skrip Posted January 9, 2009 Share Posted January 9, 2009 Hmm, I made some very big mistakes. I think I'll have to rewrite the whole UDF Sorry for that.Is that a joke, or did I find some error or something? lol.Do you know why it doesn't seem to work? [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Kip Posted January 9, 2009 Author Share Posted January 9, 2009 Not a joke. But I didn't look to the MSDN pages while making it, and I haven't done a lot of testing, so bugs could sneak in very easily. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Skrip Posted January 9, 2009 Share Posted January 9, 2009 Not a joke.But I didn't look to the MSDN pages while making it, and I haven't done a lot of testing, so bugs could sneak in very easily.Alright. Please fix it as soon as possible. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] 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