Hello,
new actions Socket.SetMaxClients() and Socket.SetPort() added to the plugin as requested. I updated the installer, but if you prefer you can just replace the current files with their updated versions, contained in this zip file.
Ulrich
Professional Software Development Tools
Hello,
new actions Socket.SetMaxClients() and Socket.SetPort() added to the plugin as requested. I updated the installer, but if you prefer you can just replace the current files with their updated versions, contained in this zip file.
Ulrich
Thanks, this is really useful.
Also, Possibility for a extra argument in Socket.Open?
Socket.Open(Plugin, Host, IP, Type[SOCKET_UDP/SOCKET_TCP])
I'm coding a system that connects to my clan's game server bot however, The instructions he's given me and the code I've come up didn't quite match. Could you give me a heads up to what the problem might be?
Is there any way to transfer files with this socket plugin?
Thanks for all!![]()
i been looking at this and i think it will replace my messenger what i have made what used php but what i like to know is how would i set the globle address to a server and if server timed out a view another server so on so forth but also include friends and blocking problem is i am not sure how i would get the server to hold this and also don't know how to use a online server insted of a local server is this possable?
Hello,
the short answer is "yes".
The long answer is that you must implement your own protocol. The socket is just a mean to exchange data with a remote computer. This data can be anything, like a message of some chat, a command of a certain game, or - why not - a packet that carries part of a file. The problem thing is that you will have to encode the binary file into text first, before you are able to transfer it, because the socket plugin will only handle strings (which cannot contain null characters). So, this is essentially the same that is done when you send an attachment by email: the file is first encoded to plain text (ASCII) before it can be sent out. When your mail reaches the recipient, that text is again converted into binary, and transformed back into the original attachment. This technique is not part of the socket, and you have to write your code to make this happen.
Ulrich
Base64 is ANSCII based
so use "Crypto.Base64EncodeToString" and then send the string, but i would split large files into sections and add some kind of information structure to the end of the Base64 string to tell the reciver what to do with the file (combine 5 parts etc, filesize, CRC value) so the reciver can rebuild and check the recived file
Hello,
I have updated the plugin a couple of times since I last posted here. It now has support for UDP sockets, three actions have changed slightly (Socket.FindServer(), Socket.GetHostByAddress() and Socket.GetHostByName()), and a new action was added: Socket.Ping().
With Socket.Ping(), you are now able to send true ICMP echo request packets to a remote computer. The action will return the number of milliseconds to get the answer from the remote host. Normally, all network adapters answer to echo requests, even if there is no service (like HTTP or FTP) running. A link to a small demo showing this new action was included in the documentation.
As always, the installer can be fetched from my site, but if you prefer you can just replace the current files with their updated versions, contained in this zip file.
Ulrich
In the documentation Socket.FindServer seems to be referencing Socket.Connect which isn't a documentated function?
Also, The Socket.GetHostByAddress and Socket.GetHostByName examples are in the wrong order.
I really like this ICMP ping, It's better than running ping using File.Run.
Thanks!
Hello,
Socket.Connect() was how I called the Socket.Open() function during development. I missed fixing the example code in the help. Thank you, the help is now corrected, and you may use the same links as before if you want to download the updated files.
I'm glad to hear that you liked the Socket.Ping(). It gave me more trouble than I initially thought.
Ulrich
Been a long time since I've been on the forums and let me just say...OMFG! I have been plaguing the forums with requests for a plugin that does this. Great job Ulrich!
I was just about to buy reteset's toolbar plugin but I'm going with Ulrich's this time. Next paycheck for the toolbar...sorry reteset. Ur plugin is way cool too...
Last edited by Centauri Soldier; 05-15-2009 at 12:30 PM.
Action Plugins
AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
Download
While making an IRC bot, I ran into a problem. The connection needs to be kept alive, but the plugin as far as I can see can't do that. I'm not too sure, It's quite urgent though. Is there a way to have keep-alive?
The socket object will not disconnect by itself, and will keep the connection open as long as possible. There is no keep-alive function that could be implemented in the socket itself.
What does exist, in FTP connections for example, is that the FTP client sends commands by itself to keep the connection alive, like LIST, NOOP, etc. Otherwise, the FTP server could assume that the connection ended and that it did not receive the command for a graceful shutdown from the client, allowing it could close the open connection on the server's end.
I assume that a similar mechanism would have to be implemented in your IRC client: When nothing is done by the user for x seconds, the client itself would need to send a NOOP message just to signal that the connection is still alive and should not be severed from the server side.
Ulrich