Raised This Month: $ Target: $400
 0% 

[SOLVED] socket_listen && socket_open error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 06-13-2012 , 04:17   Re: socket_listen && socket_open error
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
Did you just copy this and modify it?
Yup, i used server comm plugin, and mainly your socket sender plugin.
Check this thread http://forums.alliedmods.net/showthread.php?t=80413 and answer me if you can
I'm testing socket functions and transfering strings from one server to another server, but because i have only one server, i'm sending data to same ip/port on which is listening socket.

Quote:
Originally Posted by Bugsy View Post
There shouldn't be a problem with listening on one socket and connecting\sending with a different socket on the same port, you just cannot have multiple sockets listening on the same port. I don't have time to test this for you but one thing I see is you should check socket_change() on the listening socket before calling socket_accept(); this indicates that there is a connection request. Take a look at the sockets_forwards in the .inc file, it might help you solve this. Did you add some logs\[clientserver\console]_print's to confirm the entity is thinking and each piece of code is getting reached?
I don't have multiple listening sockets. I added logs, listening socket is called with "id" 7, and entity is working. SendSocket is also created, and data is sent. Just that line in think function isn't printed when i use sending function. Problem must be in socket_accept. I added debug line before socket_accept, and after entity check, and it's printed.

About socket_forward.inc, i checked almost "all socket codes" here, and noticed when using TCP socket, there is no need for socket_change check.

I forgot to mention, before puting all this in one plugin, i used 2 plugins, one for reading, one for sending, and it worked like a charm. Server is hosted on linux platform, and i'm currently using socket_hz module, modified by joaquimandrade ( Link: Here )

EDIT: Solved, i made a small tipo, check first post ( listen func )
EDIT2: joaquimandrade socket_open_non_blocking doesn't return error on connection fail, i switched back to original socket_hz.

Last edited by OvidiuS; 06-13-2012 at 12:33.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
 



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 06:15.


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