Expand|Select|Wrap|Line Numbers
- #include "ServerSocket.h"
- #include "SocketException.h"
- #include <iostream.h>
- #include <string>
- int main ( int argc, int argv[] )
- {
- try
- {
- // Create the socket
- ServerSocket server ( 30000 );
- while ( true )
- {
- ServerSocket new_sock;
- server.accept ( new_sock );
- try
- {
- while ( true )
- {
- std::string data;
- new_sock >> data;
- new_sock << data;
- }
- }
- catch ( SocketException& ) {}
- }
- }
- catch ( SocketException& e )
- {
- std::cout << "Exception was caught:" << e.description() << "\nExiting.\n";
- }
- return 0;
- }
c:\documents and settings\studentivtl\my documents\cpp1.cpp(8) : error C2039: 'cout' : is not a member of 'std'
c:\documents and settings\studentivtl\my documents\cpp1.cpp(36) : error C2039: 'cout' : is not a member of 'std'
c:\documents and settings\studentivtl\my documents\cpp1.cpp(36) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or t
here is no acceptable conversion)
Error executing cl.exe.