|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Methodz i have finished the simple winsock programme in which the the client software displays hello .Now i would like to make a Echoclient or a chat software in console mode of course (I would like to know the basic first then i would impliment it in the WI32 Api ).So I would like a bit of guidance from you .I cant understand where should i start.Do You guys have any online tutorial.What Is asynchrous sockets and is it necessary for creating echo server or chat programme.I downloaded a code from the net about a simple chat programme in that tutorial it is using a function like reqwinsockver 2_0.I have used inline function ,I have hardly used Macro's ,Even in Macros often they substitute the" ." by " _" can anybody tell me why.
Another thing is that what is a bool() function ???Can send function be used in the client software to send a string to the server software?? And why should we return -1 after each and every WSACleanUp() call??If it is to end the main function then shouldn't we return 0.Because at the end of each programme we type "return 0" |
| Sponsored Links |
|
|
|
|||
|
For a chat server you don't have to use asynchronous sockets, you can just use threads. In the server program just use CreateThread() for every connection that it accepts. Why do you need to use macros? You can also making a receiving thread in the client software and just use send() as the primary part of your program. bool when used as a function type will return true or false. They are just returning -1 for the purpose of error checking, so they can see where their code is ******* up. It doesn't really matter what you return as long as it is the type of your function. They could return 5382 and it would stuff function properly.
Last edited by xXHalfSliceXx; 07-14-2008 at 09:09 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
| Xav | ........ | 1322.18 |
| MeTh0Dz|Reb0rn | ........ | 1053.7 |
| morefood2001 | ........ | 879.43 |
| John | ........ | 877.37 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 830.24 |
| Brandon W | ........ | 735.07 |
| chili5 | ........ | 309.39 |
| Steve.L | ........ | 239.84 |
| dcs | ........ | 216.02 |
Goal: 100,000 Posts
Complete: 82%