I need some socket programing in C help
Is it possible to make a two way chat in C client - client, without having a server in between. It would be only suitable for comunication between two users not more. So socket to socket communication. I have done it in java but i have no ideer if this is even possible in C.
Maybe somebody can give me some usefull link, or maybe a simple example how this can be achived if it can be :) Thx. |
You can have computer to computer chat in C. But one of the computers is going to have to be the server. Since you have to have someone accept the connect from someone else. If you wanted to just do it with out the server you could do it with UDP, and the two computers would only need to know the IP address of the other computer. But with UDP you are not guarantee that the data will get to the other computer.
|
Buddy,
I think chat is a system were both ends act as server and client. In ur implementation in java I hope u had a streams(both ip and op) associated with sockets on either side thro which they share data and hence both act as said above. |
wit cht des he ccaionl doppd caratermater ;)
|
Yes i made it so in java (client was a server and vice versa). But i dont know so many C and so i dont know how exactly would i do that. Any help or example or anything appreciated.
|
Hi, I suggest you to read Beej guide. You can search for the same in the web.
|
as said take a look at Beej's guide :
http://beej.us/guide/bgnet/output/htmlsingle/bgnet.html you probably can use this too ( threads ) : http://www.yolinux.com/TUTORIALS/Lin...ixThreads.html egag |
All times are GMT -5. The time now is 08:27 PM. |