xzaz Posted November 24, 2007 Posted November 24, 2007 (edited) Alright, here it goes. I searched for quite some time but could'n find the problem i got this: #include"GUIConstants.au3" $g_IP = "192.168.0.8" $g_PORT = 65432 TCPStartUp() $socket = TCPConnect( $g_IP,$g_PORT) ;----------first time--------Works TCPSend($socket,"data") If $socket = -1 Then MsgBox(16,"Error!","Connection error") ;Check als de server aanstaat $GUI = GUICreate("Status script",300,300) ;-------------------------------menu------------------------- $menu = GuiCtrlCreateMenu("Menu") $login = GUICtrlCreateMenuItem("Log in",$menu) GuiSetState() While 1 $msg = GuiGetMsg() Switch $msg Case $login ;----------second time--------Dosn't work TCPSend($socket,"data") Case $GUI_EVENT_CLOSE Exit EndSwitch Wend The the first time when i send Data to the server, it works perferct. But when i place the tcpsend on the "Second time" It dosn't work. Why? Edited November 24, 2007 by xzaz Small Color Picker v0.2 | Travian bot
PsaltyDS Posted November 24, 2007 Posted November 24, 2007 Alright, here it goes. I searched for quite some time but could'n find the problem i got this:The the first time when i send Data to the server, it works perferct. But when i place the tcpsend on the "Second time" It dosn't work. Why?Are you sure the problem is on the Client/TcpSend side? You aren't showing the Server/TcpRcv side, and it may be dropping the connection after the first message is received. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
xzaz Posted November 24, 2007 Author Posted November 24, 2007 (edited) Your right (i think) about the dropping but i can see where this is my TCPRcv: While 1 If $recv <> "" Then $data = StringSplit($recv,",") if Not @error Then If $data[1] = "login" Then GuiCtrlSetData($edit,$data[2]&" has logged in" & @CRLF & GuiCtrlRead($edit)) Endif Else GuiCtrlSetData($edit,$recv & @CRLF & GuiCtrlRead($edit)) Endif Wend EndifoÝ÷ ØGbµ.®¸ ØÚºÚ"µÍÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊBÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊBÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊ I only see one "start" I think i'll pass this problem to tomorow Edited November 24, 2007 by xzaz Small Color Picker v0.2 | Travian bot
PsaltyDS Posted November 25, 2007 Posted November 25, 2007 Your right (i think) about the dropping but i can see where this is my TCPRcv: EndifoÝ÷ ØGbµ.®¸ ØÚºÚ"µÍÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊBÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊBÜÙ[ ÌÍÜÛØÚÙ] ][ÝÔÝ][ÝÊ I only see one "start" I think i'll pass this problem to tomorow Well, THERE'S your problem! The forum edit bug ate your code! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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