SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 20/05/2012, 04:23 PM   #51
BlueG
Beta Tester
 
BlueG's Avatar
 
Join Date: Sep 2007
Location: Los Angeles, CA
Posts: 229
Reputation: 257
Default Re: Socket plugin (TCP/UDP) v0.1a

Quote:
Originally Posted by KoczkaHUN View Post
I tried with NetCat, tried to CTRL+C it, or closing the Command Line, no success. RemoteDisconnect never gets called.
The callback gets called in case the socket was properly closed (aka a closesocket/shutdown call). In order to determine whether a socket has disconnected (timeouts, crashes etc), you'll have to send PING requests to all sockets. Set a timer or save a timestamp and make sure the socket replies within X seconds. If a socket doesn't reply you can close/shutdown the socket.

That's what IRC servers do to check if a client is still connected. They send "PING" messages at regular intervals to the clients and wait for a "PONG" reply.

You should google handshake protocol if you need more information about how sockets work.

Quote:
Originally Posted by T101
Dear BlueG,

Please give us some hope and tell us, that you still take care of this nice project.
Personally, i'm still very waiting for the SSL support.

Regards,
T101
I've recently fixed some small bugs, so yea, I still take care of this project. I'll most likely add support for SSL as soon as I get more time.
BlueG is offline   Reply With Quote
Old 20/05/2012, 04:57 PM   #52
Jonny5
Gangsta
 
Join Date: Mar 2012
Location: Mi, USA
Posts: 938
Reputation: 146
Default Re: Socket plugin (TCP/UDP) v0.1a

this is very good work!

i remember messing with sockets in the old vb6.0 days !
Im sure Ill be using this in the near future!
__________________
If your topic says "REP+", I ignore it.

If you haven't tried it I suggest you do so.
Pawn PlayGround By Slice!
Jonny5 is offline   Reply With Quote
Old 22/05/2012, 04:59 AM   #53
T101
Little Clucker
 
T101's Avatar
 
Join Date: Apr 2012
Posts: 29
Reputation: 4
Default Re: Socket plugin (TCP/UDP) v0.1a

Quote:
Originally Posted by BlueG View Post
I've recently fixed some small bugs, so yea, I still take care of this project.
These are great news for all of us, thanks for it BlueG .


Quote:
Originally Posted by BlueG View Post
I'll most likely add support for SSL as soon as I get more time.
I already can't wait for the release of the SSL version... .

Regards,
T101
T101 is offline   Reply With Quote
Old 08/06/2012, 07:29 PM   #54
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: Wigan, England
Posts: 2,897
Reputation: 220
Default Re: Socket plugin (TCP/UDP) v0.1a

Quote:
Originally Posted by -Luis View Post
This is the error i'm getting,
Code:
Error in socket_bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
I am still getting this error.
__________________

SA-MP Server
Luis' Fun Box - Coming Soon (PM me for more information)
---------------------------------
YouTube
YouTube | Twitter
Videos uploaded daily

Luis- is offline   Reply With Quote
Old 12/06/2012, 12:19 AM   #55
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: Wigan, England
Posts: 2,897
Reputation: 220
Default Re: Socket plugin (TCP/UDP) v0.1a

Seriously? I know somebody knows how I could attempt to fix this. Please!
__________________

SA-MP Server
Luis' Fun Box - Coming Soon (PM me for more information)
---------------------------------
YouTube
YouTube | Twitter
Videos uploaded daily

Luis- is offline   Reply With Quote
Old 13/06/2012, 08:35 PM   #56
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: Wigan, England
Posts: 2,897
Reputation: 220
Default Re: Socket plugin (TCP/UDP) v0.1a

God sake! Can someone explain what I am doing wrong please?
__________________

SA-MP Server
Luis' Fun Box - Coming Soon (PM me for more information)
---------------------------------
YouTube
YouTube | Twitter
Videos uploaded daily

Luis- is offline   Reply With Quote
Old 15/06/2012, 09:37 AM   #57
VeryGooD
Little Clucker
 
Join Date: Mar 2012
Posts: 9
Reputation: 0
Default Re: Socket plugin (TCP/UDP) v0.1a

Quote:
Originally Posted by dEzIRE View Post
the plugin crashes the server when it receives data on Linux (Centos).
on windows it works perfectly...
+1
fix it please.
VeryGooD is offline   Reply With Quote
Old 16/06/2012, 12:43 AM   #58
Misiek
Beta Tester
 
Join Date: May 2006
Posts: 116
Reputation: 11
Default Re: Socket plugin (TCP/UDP) v0.1a

Code:
*** glibc detected *** ./samp03svr: free(): invalid pointer: 0xf4673b40 ***
======= Backtrace: =========
/lib32/libc.so.6(+0x6b511)[0xf758c511]
/lib32/libc.so.6(+0x6ce1b)[0xf758de1b]
/lib32/libc.so.6(cfree+0x6d)[0xf7590f8d]
plugins/socket.so(ProcessTick+0x12b)[0xf6a2ab4b]
./samp03svr[0x80a18c2]
./samp03svr[0x807d99a]
./samp03svr[0x8077c23]
/lib32/libc.so.6(__libc_start_main+0xe7)[0xf7537e37]
./samp03svr(__gxx_personality_v0+0xf5)[0x804b4c1]
That's on Ubuntu. Too bad. It didn't crash upon receiving data, but when its connection with a client has been broken.
The plugin worked as a TCP server. The client could successfully connect and remained connected for a few minutes. When I closed the client, the server crashed. Let me know if I could provide any additional data.

Followup:

Code:
*** glibc detected *** ./samp03svr: free(): invalid pointer: 0xf4588b40 ***
======= Backtrace: =========
/lib32/libc.so.6(+0x6b511)[0xf74a1511]
/lib32/libc.so.6(+0x6ce1b)[0xf74a2e1b]
/lib32/libc.so.6(cfree+0x6d)[0xf74a5f8d]
plugins/socket.so(ProcessTick+0x12b)[0xf693fb4b]
./samp03svr[0x80a18c2]
./samp03svr[0x807d99a]
./samp03svr[0x8077c23]
/lib32/libc.so.6(__libc_start_main+0xe7)[0xf744ce37]
./samp03svr(__gxx_personality_v0+0xf5)[0x804b4c1]
This time it crashed right after sending an initial welcome message to the client.

Last edited by Misiek; 16/06/2012 at 01:34 AM.
Misiek is offline   Reply With Quote
Old 16/06/2012, 01:33 AM   #59
Misiek
Beta Tester
 
Join Date: May 2006
Posts: 116
Reputation: 11
Default Re: Socket plugin (TCP/UDP) v0.1a

Hello there.
Code:
				pData.remote_client = (char*)malloc(sizeof(char*)*15);
				pData.remote_client = inet_ntoa(remote_client.sin_addr);
->
Code:
				pData.remote_client = (char*)malloc(sizeof(char*)*15);
				strcpy(pData.remote_client, inet_ntoa(remote_client.sin_addr));
Seems to fix the problem.
Misiek is offline   Reply With Quote
Old 18/06/2012, 04:54 PM   #60
Luis-
High-roller
 
Luis-'s Avatar
 
Join Date: Jan 2010
Location: Wigan, England
Posts: 2,897
Reputation: 220
Default Re: Socket plugin (TCP/UDP) v0.1a

Please can somebody help me with my problem?
__________________

SA-MP Server
Luis' Fun Box - Coming Soon (PM me for more information)
---------------------------------
YouTube
YouTube | Twitter
Videos uploaded daily

Luis- 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 10:11 AM
Question about socket plugin Kirollos Scripting Help 6 13/07/2012 08:33 PM
Socket Plugin 147147147 Espa˝ol/Spanish 5 07/03/2012 11:22 PM


All times are GMT. The time now is 03:05 AM.


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