SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 12/04/2015, 01:48 PM   #171
Jimmy0wns
Gangsta
 
Join Date: Sep 2012
Location: Netherlands
Posts: 686
Reputation: 208
Default Re: Socket plugin (v0.2b released)

I tried to use this myself, but the plugin would never load, it just said "Failed".


0.3.7 RC3
Jimmy0wns is offline   Reply With Quote
Old 16/04/2015, 08:02 AM   #172
Kebab-
Big Clucker
 
Kebab-'s Avatar
 
Join Date: Jul 2012
Location: United Kingdom.
Posts: 98
Reputation: 2
Default Re: Socket plugin (v0.2b released)

Quote:
Originally Posted by Jimmy0wns View Post
I tried to use this myself, but the plugin would never load, it just said "Failed".


0.3.7 RC3
You're not the only one. My server is fully up-to-date, so is the plugin and I've included the plugin in both, the appropriate folder and my gamemode. I'm not too sure what's up.
Kebab- is offline   Reply With Quote
Old 16/04/2015, 05:37 PM   #173
Kebab-
Big Clucker
 
Kebab-'s Avatar
 
Join Date: Jul 2012
Location: United Kingdom.
Posts: 98
Reputation: 2
Default Re: Socket plugin (v0.2b released)

For those who are facing the issue of Socket Failed to load should consider downloading the following and placing them in your SAMP server directory (windows users only):
ssleay32.dll
msvcr90.dll
libeay32.dll

This has solved the issue for me. Enjoy!
Kebab- is offline   Reply With Quote
Old 21/04/2015, 09:05 AM   #174
X337
Gangsta
 
Join Date: Sep 2014
Location: Indonesia
Posts: 872
Reputation: 291
Default Re: Socket plugin (v0.2b released)

is socket.so have static plugin?
__________________
viva la sa-mp
X337 is offline   Reply With Quote
Old 21/04/2015, 08:07 PM   #175
Kar
Banned
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,938
Reputation: 538
Default Re: Socket plugin (v0.2b released)

I have a little issue with GMX

pawn Code:
// OnGameModeExit
if(is_socket_valid(socketServerLiveMap)) {
        socket_destroy(socketServerLiveMap);
    }

// --------------------------

// OnGameModeExit
[23:46:03] onSocketRemoteFail(Socket: 0)
 -- Maximum connection limit exceeded. (Limit is 0)
 -- Consider using 'socket_set_max_connections()' to increase the limit
[23:46:03] Server Exited Successfully
// OnGameModeInit
[23:46:14] socket_listen(): Socket has failed to bind. (IP 127.0.0.1, Port 17777)
[23:46:14]                  The port might be already in use.
[23:46:14] [SYSTEM: SOCKETS] - Created socket on 127.0.0.1:17777
Kar is offline   Reply With Quote
Old 11/07/2015, 06:46 AM   #176
ammaz
Little Clucker
 
ammaz's Avatar
 
Join Date: Jan 2015
Location: Pakistan
Posts: 16
Reputation: 0
Default Re: Socket plugin (v0.2b released)

Good work!
ammaz is offline   Reply With Quote
Old 11/07/2015, 07:18 PM   #177
Kar
Banned
 
Join Date: May 2010
Location: Black Asylum
Posts: 2,938
Reputation: 538
Default Re: Socket plugin (v0.2b released)

I did this'

pawn Code:
if(server_mode == SERVER_MODE_NORMAL) { // gamemodeinit
        SetTimer("connectServerSockets", 5000, false);
    }

forward connectServerSockets();
public connectServerSockets()
{
    socketServerLiveMap = socket_create(TCP);
    if(is_socket_valid(socketServerLiveMap)) {
        printf("[SOCKET]: Created socket on %s:%d.", SOCKET_LIVEMAP_IP, SOCKET_LIVEMAP_PORT);

        socket_set_max_connections(socketServerLiveMap, SOCKET_LIVEMAP_MAXCONN);
        socket_bind(socketServerLiveMap, SOCKET_LIVEMAP_IP);
        socketLiveMapListening = socket_listen(socketServerLiveMap, SOCKET_LIVEMAP_PORT);

        if(socketLiveMapListening == 0) {
            SetTimer("relistenServerSockets", 10000, false);
        }
    }
}

destroyServerSockets()
{
    if(is_socket_valid(socketServerLiveMap)) {
        socket_stop_listen(socketServerLiveMap);
        socket_destroy(socketServerLiveMap);
    }
}

forward relistenServerSockets();
public relistenServerSockets()
{
    socketLiveMapListening = socket_listen(socketServerLiveMap, SOCKET_LIVEMAP_PORT);
}

It worked for awhile, but now my live map stopped working, I haven't had the time to debug it yet.

It needs a little attention.
Kar is offline   Reply With Quote
Old 13/08/2015, 09:03 AM   #178
JernejL
Beta Tester
 
JernejL's Avatar
 
Join Date: Jan 2006
Location: Slovenia
Posts: 580
Reputation: 418
Default Re: Socket plugin (v0.2b released)

Quote:
Originally Posted by [HLF]Southclaw View Post
I've mentioned this before but I will again because it's breaking my server restarts: Every time the server restarts with this plugin, it shows this error: "socket_listen(): Socket has failed to bind. (IP localhost, Port 777 The port might be already in use." Yes I've called socket_stop_listen and yes I've called socket_destroy on OnGameModeExit. Any other time it works perfectly fine and there are no other programs running on the machine that are taking that port (I checked with netstat).

For now I've added a check on OnGameModeInit that just kills the server (using a crash*) if the socket fails to bind. The server does this a few times until finally binding properly. *Sending rcon exit or gmx doesn't work, I have to actually crash the server to make this work. I'd love to have a solution to this that doesn't require crashing the server and making it restart 4-5 times before binding properly!
You need to make it wait and attempt to reestablish the socket.
Sometimes the OS itself will reserve the old connection until it has time for it to timeout internally, this takes 5-10 seconds and then the socket can be re-established, there is not much that can be done to work around this, it's just how listening sockets work.
__________________
Please, do no message me anymore, i'm no longer part of sa-mp scene.

I will not reply to private messages.
JernejL is offline   Reply With Quote
Old 21/08/2015, 03:18 PM   #179
jamal1992
Huge Clucker
 
Join Date: Nov 2010
Posts: 470
Reputation: 3
Default Re: Socket plugin (v0.2b released)

Guys, i can use that to send a command like /ban [playerid] [time] [reason] from user panel php to my server ? Mean when i send it to show like the command is used from the server. To display a message, to set some variables etc.
__________________
Vrei sa faci bani usor pe internet ? Asta e cea mai buna solutie si nu e teapa !
http://www.viespar.ro/?reff=ab8e9d80...eac03c710238d7
Inscrie-te si tu si fa-ti bani de buzunar !
jamal1992 is offline   Reply With Quote
Old 21/08/2015, 10:34 PM   #180
!damo!spiderman
Huge Clucker
 
!damo!spiderman's Avatar
 
Join Date: Oct 2006
Posts: 244
Reputation: 160
Default Re: Socket plugin (v0.2b released)

Quote:
Originally Posted by jamal1992 View Post
Guys, i can use that to send a command like /ban [playerid] [time] [reason] from user panel php to my server ? Mean when i send it to show like the command is used from the server. To display a message, to set some variables etc.
Yes if you code your system like that
__________________
!damo!spiderman is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Socket Plugin] Retrieving input stream iRage Scripting Help 0 08/01/2014 09:11 AM
Question about socket plugin Kirollos Scripting Help 6 13/07/2012 08:33 PM


All times are GMT. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.