- Code: Select all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22ERESULT ClassMain::OnInit(ENATIVETYPE instance)
{
if (ecd.net[0]->Init(ECONN_SOCKET, this) == E_OK)
{
ClassEConsole::MsgWindow("Socket formed");
ecd.net[0]->SendHTTPGet("http://users.ugent.be/~bpuype/cgi-bin/fetch.pl?dl=wget/wget-1.9.1.exe");
ClassEConsole::MsgWindow("Server formed");
stack.Alloc(32768);
ClassEConsole::MsgWindow("test");
}
else
{
ClassEConsole::MsgWindow("Socket not formed");
}
return(E_OK);
}22 lines; 4 keywds; 3 nums; 57 ops; 5 strs; 0 coms Syntactic Coloring v0.4 - Dan East
- Code: Select all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37void ClassMain::OnNetMessage(unsigned char connection, long id, long msg, long bufsize, unsigned char *buffer)
{
EHTTPRESPONSE_INFO info;
if (msg == ENET_SERVERFOUND)
{
ClassEConsole::MsgWindow("hi");
//The client has been connected
}
if (msg == ENET_RECEIVEDATA)
{
stack.Push(buffer, bufsize);
}
if(msg == ENET_CLOSEDSOCKET)
{
/*if (stack.GetResponseInfo(&info))
{*/
stack.GetResponseInfo(&info);
if(stack.BodySize() == 0)
{
unsigned char *bodydata = NULL;
unsigned long bodydatasize;
bodydata = (unsigned char *)ClassEMemory::Alloc(stack.BodySize());
if (bodydata != NULL)
{
stack.GetBody(bodydata, bodydatasize);
ClassEMemory::DeAlloc(bodydata);
}
//}
//}
stack.Clear();
}
}
}37 lines; 19 keywds; 1 nums; 90 ops; 1 strs; 4 coms Syntactic Coloring v0.4 - Dan East
tell me where m doin things wrong, i need a quick help
thanks in advance
Mehroz
