emoyasha Posted March 19, 2008 Share Posted March 19, 2008 (edited) okay here is the problem 1) the client sends a message to the server 2)the server relays the message to the user 3)sometimes the the user client program is busy, and dose not receive the packet so im goign to upload the scripts, and wonder if there is any way to make sure every packet sent reches its destination like a verification process or something that would make sure the message is received but not slow things down. and help would be appriciated, thanks. Revelution_Messenger.au3 server.au3 (sorry about the begging of the code being a bit of a mess, however the message functions are commented so you should be able to understand how they work easy) Edited March 19, 2008 by emoyasha Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
emoyasha Posted March 19, 2008 Author Share Posted March 19, 2008 please note there is a line 947 error for a "endif" with no matching "if", just remove the "else endif" Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
FreeFry Posted March 19, 2008 Share Posted March 19, 2008 I haven't looked at your script yet, but as far as I know, the received data(in autoit) is stored in a buffer until it is read(unless the data sent exceeds the 'maxlen' parameter in TCPRecv. Perhaps have another script handle the TCP connections? Link to comment Share on other sites More sharing options...
emoyasha Posted March 19, 2008 Author Share Posted March 19, 2008 ahh u dont understand the problem. lol its transfered perfectly, but the client dose lots of things at once, and is not always waiting for data making a 10% chnace of th epacket getting lost, so im looking for a way to confirm the packet got to its destination, and if not to send it again. Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
FreeFry Posted March 19, 2008 Share Posted March 19, 2008 (edited) When you use TCP, the data is always(automatically) confirmed that it arrives at it's destination(that's how the TCP protocol is designed, read more here: http://en.wikipedia.org/wiki/Transmission_Control_Protocol).And, when you open a socket(using TCPAccept), it should receive the data sent to it, until you retrieve it with TCPRecv..That's how I understand that the autoit handling works atleast...In any case, it shouldn't "miss" a packet, because it would automatically be retransmitted, and otherwise, it should be stored in a buffer until it's read(with TCPRecv), so if it's not getting the message when it's sent, there must be some other problem in your code.Any of the developers of AutoIt might wanna step in and explain this if I'm wrong about it..Edit:Exactly what packet is it that it is missing/where is it missing? Edited March 19, 2008 by FreeFry Link to comment Share on other sites More sharing options...
emoyasha Posted March 19, 2008 Author Share Posted March 19, 2008 as i said before, this is a messenger program it sends and receives data while connected to a server, there is an occasion 10-20% of the time that a message is sent to the client, while the client is sending a packet to see if a user is online, therefor its not waiting for an incoming message, so it ignores the message and waits for the online packet. the way autoit handles tcp packets when transmitting a lot of data is that it can lose a packet, rather not lose it, but it can be received in the wrong place, such as the online info. so i want a way for the client to send a packet to the server apon receiving a message to confirm the message received, and for the server to retry until it gets a confirmed message, and to make a que of mesages in case a second message is sent while another message is attempting to be sent. i tried this, and i got some strange results a couple of times, like messages being combined, and coming out funny (because they are encrypted) and not working all together... Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
emoyasha Posted March 20, 2008 Author Share Posted March 20, 2008 ALSO THE ENTIRE PROGRAM SEEMS TO freeze up some times for some reason and/or respond very slow. Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
emoyasha Posted March 20, 2008 Author Share Posted March 20, 2008 -bump- Spoiler Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)----------------------------------- Link to comment Share on other sites More sharing options...
FreeFry Posted March 21, 2008 Share Posted March 21, 2008 I'm sorry in that case I don't really know what's wrong with your script. :/ Maybe some of the more experienced can help. Link to comment Share on other sites More sharing options...
qsek Posted June 8, 2008 Share Posted June 8, 2008 @emoyasha:I use TCPSend and TCPRecv for an Clientconsole/Server application, and i can say that i never expierienced an unreasonable loss of answers to a TCP request.I only send 2 to max. 5 requests per second, and after one request i go into the recv loop, which loops till it gets the right answer.I think understand what you want to say: If you send a lot of Stuff in a small Time Window (like 100 x TCPSend($socket,"stuff") in a loop with no sleep) then it can occur that the TCP protocol is busy sending and doesnt recognise any ingoing data.Well that could be or not, but then its not a problem with autoit, but the TCP Protocol. But then People would really have a problem, if 10-20% of data in the internet is being lost when the reciever is currently sending.I assume that that the TCP protocol puts the data in the buffer, that is read by the TCPRecv Function.I also dont think that in this step anything could go wrong.So its more likely that in rare cases your recv loop recieves data, but thinks it didnt receive anything.It could be a matter of wrong conditions or something like that.It also could be that you do a TCPRecv too fast after a TCPSend, so it recieves nothing because the answer is still on the way.In every case it would help a lot if you show us your code, so we can go through the steps and see the way your dealing with TCP functions.It would also be good to know how you determine, if data is being lost. Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite 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