Socket plugin issue

Started by ysc3839, Mar 06, 2016, 07:59 AM

Previous topic - Next topic

ysc3839

When a client connect to the server started by socket plugin, the server crash. If I don't set the "NewConn" function the server won't crash.
function StartSocket()
{
Socket <- NewSocket("DataFunc");
Socket.SetNewConnFunc("NewConn");
Socket.Start(1234, 5);
}

function DataFunc(client, data)
{
print(client + ":" + data);
}

function NewConn(a, b, c)
{
print(a + " " + b + " " + c);
}

KAKAN

Quote from: ysc3839 on Mar 06, 2016, 07:59 AMWhen a client connect to the server started by socket plugin, the server crash. If I don't set the "NewConn" function the server won't crash.
function StartSocket()
{
Socket <- NewSocket("DataFunc");
Socket.SetNewConnFunc("NewConn");
Socket.Start(1234, 5);
}

function DataFunc(client, data)
{
print(client + ":" + data);
}

function NewConn(a, b, c)
{
print(a + " " + b + " " + c);
}
I think that the NewConn would recieve only 2 params or 1, so try removing C, and if it doesn't work, then remove c and b.
And also, the socket plugin is bugged.
P.s:- Can you fill up the wiki's Socket section with some working examples?
oh no

ysc3839

Quote from: KAKAN on Mar 06, 2016, 08:13 AM
Quote from: ysc3839 on Mar 06, 2016, 07:59 AMWhen a client connect to the server started by socket plugin, the server crash. If I don't set the "NewConn" function the server won't crash.
function StartSocket()
{
Socket <- NewSocket("DataFunc");
Socket.SetNewConnFunc("NewConn");
Socket.Start(1234, 5);
}

function DataFunc(client, data)
{
print(client + ":" + data);
}

function NewConn(a, b, c)
{
print(a + " " + b + " " + c);
}
I think that the NewConn would recieve only 2 params or 1, so try removing C, and if it doesn't work, then remove c and b.
And also, the socket plugin is bugged.
P.s:- Can you fill up the wiki's Socket section with some working examples?
I saw the code, it's 3 params. I'll debug it on next weekend.
If you want me fill up the wiki, you should make it works first.