Raised This Month: $51 Target: $400
 12% 

[EXTENSION] Socket (3.0.1)


Post New Thread Reply   
 
Thread Tools Display Modes
ogre_x
Member
Join Date: Dec 2008
Location: Sweden
Old 01-13-2009 , 17:56   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #91

Nice, tried it out today and it worked fine. Thanks.
__________________
ogre_x is offline
MulleDK19
New Member
Join Date: Jan 2009
Old 01-14-2009 , 08:30   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #92

Works great. Thanks.

But ehm... How do I fix it not being able to download binary files right? (example.sp)

Says it receives 1460 bytes OnSocketReceive, but it's not.

Quote:
strlen(receiveData): 283
Received 1460 bytes from socket 15859783
strlen(receiveData): 381
Received 1460 bytes from socket 15859783
strlen(receiveData): 936
Received 1460 bytes from socket 15859783
strlen(receiveData): 52
Received 1460 bytes from socket 15859783
strlen(receiveData): 478
Received 1460 bytes from socket 15859783
strlen(receiveData): 389
Received 1460 bytes from socket 15859783
strlen(receiveData): 146
Received 1460 bytes from socket 15859783
strlen(receiveData): 578
Received 1460 bytes from socket 15859783
strlen(receiveData): 197
Received 934 bytes from socket 15859783

//Original file is 12614 bytes... Downloaded is 3440 bytes.

Last edited by MulleDK19; 01-14-2009 at 08:33.
MulleDK19 is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 01-14-2009 , 08:51   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #93

I'm not the pro on this, but doesn't strlen show the amount of characters returned, and the byte size is the size of each of those characters added together? If that's the case, strlen should always be less than the byte size returned, so there shouldn't be any problem.
bl4nk is offline
MulleDK19
New Member
Join Date: Jan 2009
Old 01-14-2009 , 08:55   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #94

Quote:
Originally Posted by bl4nk View Post
I'm not the pro on this, but doesn't strlen show the amount of characters returned, and the byte size is the size of each of those characters added together? If that's the case, strlen should always be less than the byte size returned, so there shouldn't be any problem.
The downloaded file is the size of those strlen's together.

If I check the file, it is 3440 bytes in size.

283+381+936+52+478+389+146+578+197 = 3440.

Last edited by MulleDK19; 01-14-2009 at 09:00.
MulleDK19 is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 01-14-2009 , 09:55   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #95

You must not use strlen and others for binary files. Strings are usually terminated with a 0x00 byte, but binary data can contain 0x00 right in the middle, so you'd only process a part of the data with binary-unsafe functions.

If you want to save something binary-safe to a file, try using

WriteFile(fileHandle, receiveData, dataSize/4, 4);
for (new i=(dataSize/4)*4; i<dataSize; i++)
WriteFile(fileHandle, receiveData[i], 1, 1);
sfPlayer is offline
MulleDK19
New Member
Join Date: Jan 2009
Old 01-14-2009 , 09:59   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #96

Quote:
Originally Posted by sfPlayer View Post
You must not use strlen and others for binary files. Strings are usually terminated with a 0x00 byte, but binary data can contain 0x00 right in the middle, so you'd only process a part of the data with binary-unsafe functions.

If you want to save something binary-safe to a file, try using

WriteFile(fileHandle, receiveData, dataSize/4, 4);
for (new i=(dataSize/4)*4; i<dataSize; i++)
WriteFile(fileHandle, receiveData[i], 1, 1);
Thanks, I'll try.

Edit: Works. Thanks

Last edited by MulleDK19; 01-14-2009 at 10:10.
MulleDK19 is offline
lhffan
Senior Member
Join Date: Jul 2008
Old 01-18-2009 , 17:17   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #97

im using this plugin with another one and i get this error

Quote:
L 01/18/2009 - 208:46: [vacbans.smx] Socket error 3 (errno 10060)
L 01/18/2009 - 20:41:19: [vacbans.smx] Socket error 6 (errno 0)
lhffan is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 01-18-2009 , 19:17   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #98

10060 = connection timed out

maybe the destination is offline or firewalled
sfPlayer is offline
Shnooter
Junior Member
Join Date: Nov 2008
Old 02-09-2009 , 12:43   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #99

I'm getting this error:

Code:
[META]Failed to load plugin addons/sourcemod/extensions/socket.ext.so. Function CreateInterface not found.
Any reason why I might get this?
Shnooter is offline
sfPlayer
Senior Member
Join Date: Dec 2007
Location: Germany
Old 02-09-2009 , 12:50   Re: [EXTENSION] Socket (2.4.0beta+2.1)
Reply With Quote #100

You seem to try to load it as a Metamod extension which it isn't.

You don't need to configure the socket extension at all, just upload it and you're done.
sfPlayer is offline
Reply



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 01:53.


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