hey guys,
i am trying to build a chat server.....but whn the server is sending login ack the server starts receiving out of order packets.....login ack is send when a username and password matches... format for username and password is username pasword:

plz help me short out the prob.

thnks in advance....

I'd suggest you distill this a bit until you get things working. Then put the pieces together as they are verified. FOr instance, the fact that you have the following sequence of events

data = (char *) malloc(size );
data = (char *) arg ;

means to me that you have be editing this code in place for quite some time now (or you dont understand memory management and logical flow of execution). Try starting with just the parts that accept a connection (remove all threads for now) send a message to the server, respond, terminate connection. Once that is working, proceed to prompting for a login, passing that to the server, having the server check that and respond, then terminate the connection. And so on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.