Tcp objects
And I would use these to do this how?
I don't know any of the code I need though. The external program is in C#.And both of these programs are on the same computer, which would probably create a faster method that doesn't require routing and stuff.
function InitConnection(%server,%port) //Creates a tcp object{ if(isObject(TCPObjecty)) TCPObjecty.delete(); new TCPObject(TCPObjecty) { site = %server; port = %Port; connected = 0; };}function TCPObjecty:onLine(%this,%line) //Called when client gets sent stuff{}function TCPObjecty::sendLine(%this,%line) //Sends a line{ %this.send(%line);}function TCPObjecty::onConnected(%this) //called when connected{ %this.connected = 1;}TCPObjecty.connect(%server@":"@%port); //Attempts to connectTCPObjecty.disconnect();^^ Un-needed because:this excellent post by Trinick
If it's over local connections, you shouldn't have to have your ports forwarded. Your firewall must allow Blockland through those specific ports however.IIRC, TCPObjects and TCPClients are the same thing. TCPListeners do exactly what their name implies, they listen on a port but don't send any data.
But TCPlisteners in C# seem to be able to send data. The example I found and used to help with the script involves the listener (being the server) sending a response to the client after it receives data.Also should I have Blockland as the client or the server?
The external command is going to be sending Blockland a series of strings and a Blockland script will decide what to do with them. If possible, I would like it to alternate between the program sending Blockland information and Blockland sending the program feedback ('yes, I have this string, and I did this with it')
Ohwaitgod. C# needs to convert the data to bytes to transmit it. How do I decode this in Blockland?(The method used in C# is System.Text.ASCIIEncoding.Get Bytes(string s))