Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 05:32

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Socket Error

Discussion on Socket Error within the C/C++ forum part of the Coders Den category.

Reply
 
Old 06/15/2013, 20:29   #16
 
elite*gold: 0
Join Date: Jun 2013
Posts: 9
Received Thanks: 0
You should better learn the basics instead of developing a pserver.
inc_p0int is offline  
Old 06/15/2013, 22:17   #17
 
artfulwave's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 20
Received Thanks: 0
Quote:
Originally Posted by inc_p0int View Post
You should better learn the basics instead of developing a pserver.
Quote:
Originally Posted by ernilos View Post
The client works perfectly, isn't coded by me(I'm developing p.server) ><
She/He is right...And i think if you have coded the whole project yourself you would have known what`s the problem.
For which game are you developing this P.S. ?
Provide more info to get help.
artfulwave is offline  
Old 06/15/2013, 22:35   #18
 
elite*gold: 0
Join Date: Oct 2010
Posts: 514
Received Thanks: 65
Question

Quote:
Originally Posted by artfulwave View Post
She/He is right...And i think if you have coded the whole project yourself you would have known what`s the problem.
For which game are you developing this P.S. ?
Provide more info to get help.
NosTale.
szymek111 is offline  
Old 06/16/2013, 01:00   #19
 
ernilos's Avatar
 
elite*gold: 20
Join Date: Jan 2012
Posts: 766
Received Thanks: 645
I have all algorythm's working perfectly, litlle crashes i know how works all packets etc… but idk why i can't recv all packet from the client just need fix it :I
ernilos is offline  
Old 06/16/2013, 20:30   #20
 
Padmak's Avatar
 
elite*gold: 58
Join Date: Jun 2008
Posts: 2,311
Received Thanks: 8,420
I think you need to buffer the incoming packets and process them everytime some new packets arrive.
Like this:
Code:
int rcv = recv(.. &buf...);
if(rcv > 0)
{
    nw_buf.push_back(buf, rcv);
    packethandler(nw_buf);
}

void packethandler(buf_type bf)
{
    while(process_packet(bf) != TOO_SHORT)
    {
        packethandler(bf);
    }
}
It's some ugly pseudo-code but i think it'll help you to get the gist of what i'm trying to say

Padmak
Padmak is offline  
Old 06/16/2013, 21:36   #21
 
Master674b's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 255
Received Thanks: 110
Quote:
Originally Posted by Padmak View Post
I think you need to buffer the incoming packets and process them everytime some new packets arrive.
Like this:
Code:
int rcv = recv(.. &buf...);
if(rcv > 0)
{
    nw_buf.push_back(buf, rcv);
    packethandler(nw_buf);
}

void packethandler(buf_type bf)
{
    while(process_packet(bf) != TOO_SHORT)
    {
        packethandler(bf);
    }
}
It's some ugly pseudo-code but i think it'll help you to get the gist of what i'm trying to say

Padmak
What? Normally you got a TCPClient class which holds a socket, just do an async_read of like 4 bytes for the packet opcode and call your handler and let the handler read more from the socket if he needs it.
Master674b is offline  
Reply


Similar Threads Similar Threads
Socket Error
12/23/2012 - S4 League - 2 Replies
Hey, i wanna a Solution for this Problem http://img823.imageshack.us/img823/7619/67715599. jpg
PBDO Bot Error !! A Socket connection error while connecting to the bot auth server.
12/08/2012 - DarkOrbit - 11 Replies
A Socket connection error while connecting to the bot auth server. Trying another one. ERROR PBDO
Port/Socket Error
01/11/2012 - CO2 Private Server - 4 Replies
Alright, pretty sure this is the right place to post this. I have decided to fool around with CO PServers as all I have ever coded and messed with is Java. I have touched a little bit into C# before but nothing major. But this is besides the point, actually I am fairly certain this has nothing to do with the coding of the server (oddly enough?). Basically I have the ports 9958/5816 forwarded, added exceptions in firewall (inbound and outbound) and even tried cutting off the firewall, yet...
socket error W[200] L[........
02/13/2011 - CrossFire - 4 Replies
habe folgendes problem bei crossfire (habe keine hacks bots... auf mein pc) habe windows7 32bit und wenn ich crossfire im abgesiicherten modus installire dann pc neu starte und starten will bleibt es bei der check box auf 66% stehen und es kommt die oben genannte fehler meldung wie kann ich das beheben ?
Socket Error?
07/29/2010 - S4 League - 8 Replies
Everything is alright everything loads up. Then this pops up! Why is this happening and how do I fix it? http://i285.photobucket.com/albums/ll54/animecraz ed598/S4leagueError2.jpg



All times are GMT +1. The time now is 05:33.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.