Raised This Month: $32 Target: $400
 8% 

[EXTENSION] Socket (3.0.1)


Post New Thread Reply   
 
Thread Tools Display Modes
gabr1ell
Junior Member
Join Date: Jul 2019
Old 08-13-2020 , 11:01   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #561

I'm having trouble compiling the version of JoinedSenses (https://github.com/JoinedSenses/sm-ext-socket) can someone who compiled send me?

Thanks
gabr1ell is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 09-14-2020 , 00:42   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #562

https://github.com/JoinedSenses/sm-ext-socket/releases

No need to compile
__________________
JoinedSenses is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-09-2021 , 11:20   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #563

Code:
public void OnSocketIncoming(Socket socket, Socket newSocket, const char[] remoteIP, int remotePort, any arg) {         PrintToServer("%s:%d connected", remoteIP, remotePort);     // setup callbacks required to 'enable' newSocket     // newSocket won't process data until these callbacks are set     newSocket.SetReceiveCallback(OnChildSocketReceive);     newSocket.SetDisconnectCallback(OnChildSocketDisconnected);     newSocket.SetErrorCallback(OnChildSocketError);     newSocket.Send("send quit to quit\n"); }

remoteIP always null for latest build for winos

Last edited by ZASTRELIS; 01-09-2021 at 12:03.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-09-2021 , 13:02   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #564

SOURCE CODE
Can't send correct response for serverEx command to the receiver.. or it's possible only in OnSocketIncoming?

I tried to send command from my site, it works by OnChildSocketReceive but in this CB I can't response to my request using command buffer

P.S. I found that it works, but sometimes.. How send with same frame as callback?

Solved by: socket.SetOption(SocketLinger, 1);

P.S.S. I'm not understood why I must close socket handle after when every ReceiveCallback will be finished

Last edited by ZASTRELIS; 01-09-2021 at 17:11.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-10-2021 , 07:23   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #565

how to decode post via sm?

Last edited by ZASTRELIS; 01-10-2021 at 07:24.
ZASTRELIS is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 01-10-2021 , 07:49   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #566

Use an HTTP extension like SteamWorks or REST in Pawn.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-10-2021 , 08:06   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #567

Quote:
Originally Posted by DJ Tsunami View Post
Use an HTTP extension like SteamWorks or REST in Pawn.
can you tell more precisely which method you know for this? because I looked into steamworks and json and not found urldecode methods..

Last edited by ZASTRELIS; 01-10-2021 at 08:09.
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-10-2021 , 10:12   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #568

I'm nothing to understand in how to build extensions for sm, so I write my own simple URLDecode method for replacing percent characters
Code:
for(int i = 0; i < sizeof(symbols); ++i) {     if(StrContains(receiveData[ch+6], symbols[i][1], false) != -1)     {         ReplaceString(receiveData, dataSize, symbols[i][1], symbols[i][0], false);     } }
But I know that in C++ and Boost it will be works faster.. so I will be waiting for normal URLDecode for UTF-8 w Cyrilic support..
P.S. this source was very helpful https://urldecoder.org/
P.S.S. for courteous Russians: https://snipp.ru/handbk/url-code

Last edited by ZASTRELIS; 01-16-2021 at 02:40. Reason: all works fine, my problem
ZASTRELIS is offline
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 01-14-2021 , 09:37   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #569

this an example for writing the file, how about sending file in response for OnChildSocketReceive? This responses' size over 20KB..

Last edited by ZASTRELIS; 01-14-2021 at 11:42.
ZASTRELIS is offline
BlagoYar
Member
Join Date: Nov 2018
Location: Чер
Old 03-21-2021 , 21:26   Re: [EXTENSION] Socket (3.0.1)
Reply With Quote #570

How to fix
Quote:
Socket Error (2): ErrorType 6, ErrorNum 111
__________________
BlagoYar is offline
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

Forum Jump


All times are GMT -4. The time now is 08:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode