Quote:
Originally Posted by Exolent[jNr]
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
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.