bird42 Posted December 8, 2008 Share Posted December 8, 2008 Hello! How can i send datas to an IP like that 192.168.1.4:27015 ?? Link to comment Share on other sites More sharing options...
furrycow Posted December 8, 2008 Share Posted December 8, 2008 Hello!How can i send datas to an IP like that 192.168.1.4:27015 ??What do you mean by send data? You talking the full blown sending files through ftp or just a simple ping?? Instant Lockerz Invite - www.instantlockerzinvite.co.uk Link to comment Share on other sites More sharing options...
SetEnv Posted December 8, 2008 Share Posted December 8, 2008 Hmm, not sure is that you really need, but you could use 'TCPSend()' Here an example given by the help file: expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) ;============================================== ;============================================== ;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!! ;============================================== ;============================================== Example() Func Example() ; Set Some reusable info ;-------------------------- Local $ConnectedSocket, $szData ; Set $szIPADDRESS to wherever the SERVER is. We will change a PC name into an IP Address ; Local $szServerPC = @ComputerName ; Local $szIPADDRESS = TCPNameToIP($szServerPC) Local $szIPADDRESS = @IPAddress1 Local $nPORT = 33891 ; Start The TCP Services ;============================================== TCPStartup() ; Initialize a variable to represent a connection ;============================================== $ConnectedSocket = -1 ;Attempt to connect to SERVER at its IP and PORT 33891 ;======================================================= $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT) ; If there is an error... show it If @error Then MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error) ; If there is no error loop an inputbox for data ; to send to the SERVER. Else ;Loop forever asking for data to send to the SERVER While 1 ; InputBox for data to transmit $szData = InputBox("Data for Server", @LF & @LF & "Enter data to transmit to the SERVER:") ; If they cancel the InputBox or leave it blank we exit our forever loop If @error Or $szData = "" Then ExitLoop ; We should have data in $szData... lets attempt to send it through our connected socket. TCPSend($ConnectedSocket, $szData) ; If the send failed with @error then the socket has disconnected ;---------------------------------------------------------------- If @error Then ExitLoop WEnd EndIf EndFunc ;==>Example Link to comment Share on other sites More sharing options...
bird42 Posted December 8, 2008 Author Share Posted December 8, 2008 Thx for help. 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