yucatan Posted May 11, 2008 Share Posted May 11, 2008 (edited) hi is it possebel to send a $var from the server to the client? i'm trying for 3 days now and i cànt get it working pleas somebody help me. PLEAS Edited May 11, 2008 by yucatan Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 11, 2008 Moderators Share Posted May 11, 2008 hi is it possebel to send a $var from the server to the client? i'm trying for 3 days now and i cànt get it working pleas somebody help me. PLEASAre we to guess what $var is?The answer is a "simple" yes. Now, whether what you've coded can, well that remains a mystery as you haven't posted the code you've tried, what succeeds, and what fails.A guess: Use StringToBinary before sending, and BinaryToString to decipher. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
yucatan Posted May 11, 2008 Author Share Posted May 11, 2008 ok i post code server ;SERVER!! Start Me First !!!!!!!!!!!!!!! $g_IP = "127.0.0.1" ; Start The TCP Services ;============================================== TCPStartUp() Dim $stream = "streaming" ; Create a Listening "SOCKET" ;============================================== $MainSocket = TCPListen($g_IP, 65432, 100 ) If $MainSocket = -1 Then Exit ; look for client connection ;-------------------- While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then TCPSend($ConnectedSocket, $stream) EndIf Wend client ;CLIENT!!!!!!!! Start SERVER First... dummy!! $g_IP = "127.0.0.1" ; Start The TCP Services ;============================================== TCPStartUp() $stream = "" ; Connect to a Listening "SOCKET" ;============================================== $socket = TCPConnect( $g_IP, 65432 ) If $socket = -1 Then Exit TCPRecv( $socket, 2048 ) MsgBox(4096, "Test", $stream ) Link to comment Share on other sites More sharing options...
Kip Posted May 11, 2008 Share Posted May 11, 2008 are you in a local network? maybe you can try @IPAddress1 than. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
yucatan Posted May 11, 2008 Author Share Posted May 11, 2008 are you in a local network? maybe you can try @IPAddress1 than. i'm writing it on one system but i can connect that for sure but giving the var from the server to the client that dont work Link to comment Share on other sites More sharing options...
Kip Posted May 11, 2008 Share Posted May 11, 2008 (edited) what if you use this client script? ;CLIENT!!!!!!!! Start SERVER First... dummy!! $g_IP = "127.0.0.1" ; Start The TCP Services ;============================================== TCPStartUp() $stream = "" ; Connect to a Listening "SOCKET" ;============================================== $socket = TCPConnect( $g_IP, 65432 ) If $socket = -1 Then Exit do $Recv = TCPRecv( $socket, 2048 ) until $Recv MsgBox(4096, "Test", $Recv ) Edited May 11, 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...
yucatan Posted May 11, 2008 Author Share Posted May 11, 2008 what if you use this client script? ;CLIENT!!!!!!!! Start SERVER First... dummy!! $g_IP = "127.0.0.1" ; Start The TCP Services ;============================================== TCPStartUp() $stream = "" ; Connect to a Listening "SOCKET" ;============================================== $socket = TCPConnect( $g_IP, 65432 ) If $socket = -1 Then Exit do $Recv = TCPRecv( $socket, 2048 ) until $Recv MsgBox(4096, "Test", $Recv ) thats right.. so .. whats your piont ;-------------------- While 1 $ConnectedSocket = TCPAccept( $MainSocket) If $ConnectedSocket >= 0 Then msgbox(0,"","my server - Client Connected") TCPSend($ConnectedSocket, $stream) EndIf Wend so that means do it when it returns NO error then do msgbox(0,"","my server - Client Connected") TCPSend($ConnectedSocket, $stream) i know that -1 is the error level so 0 means NO error.... Link to comment Share on other sites More sharing options...
yucatan Posted May 11, 2008 Author Share Posted May 11, 2008 (edited) thats right.. so .. whats your piont;--------------------While 1$ConnectedSocket = TCPAccept( $MainSocket)If $ConnectedSocket >= 0 Then msgbox(0,"","my server - Client Connected") TCPSend($ConnectedSocket, $stream)EndIfWendso that means do it when it returns NO error then do msgbox(0,"","my server - Client Connected") TCPSend($ConnectedSocket, $stream)i know that -1 is the error level so 0 means NO error....hehe it works can u tell me what i did wrong?i need that this prog always work,, witch port i can use the best ? Edited May 11, 2008 by yucatan Link to comment Share on other sites More sharing options...
Kip Posted May 12, 2008 Share Posted May 12, 2008 witch port i can use the best ?doesn't matter so much, just a port below 1024 MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
yucatan Posted May 12, 2008 Author Share Posted May 12, 2008 doesn't matter so much, just a port below 1024hmm.. do i need to open the port then ???? in my router (i hope not) Link to comment Share on other sites More sharing options...
Kip Posted May 12, 2008 Share Posted May 12, 2008 The computer with the server should have a port opened. All the clients don't have to open a port, they only need to have acces to the internet. (the firewall should also be configured) MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
yucatan Posted May 12, 2008 Author Share Posted May 12, 2008 The computer with the server should have a port opened.All the clients don't have to open a port, they only need to have acces to the internet. (the firewall should also be configured)damm then my prog wont work. Link to comment Share on other sites More sharing options...
Kip Posted May 12, 2008 Share Posted May 12, 2008 what are you trying? MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
yucatan Posted May 12, 2008 Author Share Posted May 12, 2008 (edited) what are you trying?a streamer and a checker and when i enter your IP adres in the checker then the checker needs to detect if you have the streamer installed so i work with a directi connection now maby i need to do it els then maby i need to make it like this then the streamer makes a file on a server somehere and that the checker search in server to your ip or something thats with a server now is the prog U run the server, Edited May 12, 2008 by yucatan 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