[Plugin] [BETA] SA:MP Sockets Plugin
#21

Nice, it will allow users many things!

I'm currently making a RakNet plugin (similar to this)

Edit: RakNet & PAWN SDK incompatibility issues fixed

Also, windows link is down.
Reply
#22

Good work StrickenKid! I remember testing this some months ago, lol.
Reply
#23

Updated to R2.

Thanks for the bug reports
Reply
#24

Very nice job !
Reply
#25

Good, but have a problem, Send sockets to other servers, that's good can share information, but they could attack other servers with a little ingenuity, you could make enemies crasher servers only send sockets indicating a timer.And its good for connect samp server with another program
Reply
#26

SA-MP uses UDP, and this is a TCP plugin. You could only send data to other servers using this plugin.

Great update, StrickenKid, although it seems that there is now another error - I keep getting WSA error 10054 when trying to send data multiple times, and there is actually a problem.
I sent 14 bytes to a client, then 6 bytes, (two seperate socket_send calls) but the 6 bytes are a copy of the first 6 of the 14 I sent earlier.
Reply
#27

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
SA-MP uses UDP, and this is a TCP plugin. You could only send data to other servers using this plugin.
If both servers had this plugin, it is possible.. although I doubt it would be enough to take it down.
Reply
#28

Quote:

[13:27:01] Loading plugin: sockets.so
[13:27:01] Failed (plugins/sockets.so: undefined symbol: sock)

Uhm, what?
Reply
#29

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
SA-MP uses UDP, and this is a TCP plugin. You could only send data to other servers using this plugin.

Great update, StrickenKid, although it seems that there is now another error - I keep getting WSA error 10054 when trying to send data multiple times, and there is actually a problem.
I sent 14 bytes to a client, then 6 bytes, (two seperate socket_send calls) but the 6 bytes are a copy of the first 6 of the 14 I sent earlier.
Yes, that could be a TCP issue. Read a little about TCP, and you will see TCP can't guarantee that the receiver will get the full amount of data you sent. Sometimes you need to send it twice or more to actually send the data correctly.


I know I already said it, but I'm currently working on a RakNet based plugin, and as far as I know RakNet does not have these issues.
Reply
#30

Quote:
Originally Posted by bpeterson
Посмотреть сообщение
Yes, that could be a TCP issue. Read a little about TCP, and you will see TCP can't guarantee that the receiver will get the full amount of data you sent. Sometimes you need to send it twice or more to actually send the data correctly.


I know I already said it, but I'm currently working on a RakNet based plugin, and as far as I know RakNet does not have these issues.
TCP has an inbuilt check to ensure it has been sent(, thats why it is slower.) Are you sure that you don't mean UDP? Or do you mean the size of the puffer? "Read a little about TCP".
And raknet is a layer over UDP, not TCP.
ev0lutionnn is totally right.
Reply
#31

RakNet uses UDP.
TCP checks for packet loss unlike UDP.
Reply
#32

Sorry, I meant UDP.
Reply
#33

Quote:
Originally Posted by bpeterson
Посмотреть сообщение
Sorry, I meant UDP.
Yes... you meant UDP, which has the issues you claim to be the cause of my problem. You say this despite this plugin clearly being TCP.
And your solution is to build a plugin which uses UDP? (because, as hencz said, RakNet uses UDP)
Reply
#34

This could be useful for making a very simple fast IRC script....
Reply
#35

Quote:
Originally Posted by Micheliano
Посмотреть сообщение
wow.

You could connect multiple SA:MP server's chats together, or create a custom rcon panel, or pretty much anything else.

can;t wait for the stable verison. Good Work!
A custom rcon panel would be good. I could do it but I don't know if it would be useful If someone could use it then PM me maybe with players on map and chat or something.
Reply
#36

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
Yes... you meant UDP, which has the issues you claim to be the cause of my problem. You say this despite this plugin clearly being TCP.
And your solution is to build a plugin which uses UDP? (because, as hencz said, RakNet uses UDP)
No, I'm making a RakNet version of this plugin, just to compare speed etc..
Reply
#37

Thanks for the suggestions, I am planning on updating the plugin once I get a chance.

For the past few weeks, I've been working on a total new project (not a plugin), so I've been spending all my time on that.
Reply
#38

I love this plugin and i have remade some old projects that i had issues with using this plugin. It makes life easier for me. Keep it going, unlike me. lol
Reply
#39

Quote:
Originally Posted by ev0lutionnn
Посмотреть сообщение
Some problems, from a Windows server:

1. Occasionally the plugin returns WSA error code 10004 or 10038 - usually with 10004 the function called works as normal
2. Occasionally the plugin claims that socket_send fails, or that the "last receive failed", when neither do, and they both actually work
3. If a client connects, sends something to the server and disconnects, the plugin doesn't handle it fast enough, and crashes after "Client x closed the connection" (before it calls OnSocketRecieve)
4. Unless I'm missing something, the plugin seems to only ever send 4 bytes per socket_send call. For example, I connected via a PHP script (the client) and wrote 12 bytes to the socket. The server-side script uses socket_send to send "thisisatest" back to the connected client. The connected client receives "test". It seems to be the same with any string sent.. only 4 bytes are sent.

Great plugin though, I'm using it for a project now which wouldn't have been possible without it. Very useful, just needs a few bugs fixed. :P
i have the same problem.
i use a PHP client to send data,the then samp return "done" to the client, client can successful recieve the data,but after that,samp-server crash. Before the server crash ,the server.log shows :"Client xxxxx closed the connection."

And also, this plugin seem to add some strange text after the right data when i use the OnSocketReceive,and it casue many problem,i have to use sscanf to ignoe the strange text.

and sorry for my bad english
Reply
#40

thanks, great plugin!
continue to develop it

Sorry me for my bad english)
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)