• 欢迎浏览“String me = Creater\忠实的资深Linux玩家;”,请文明浏览,理性发言,有侵犯你的权益请邮件我(creater@vip.qq.com).
  • 把任何的失败都当作一次尝试,不要自卑;把所有的成功都想成是一种幸运,不要自傲。
  •    5年前 (2013-06-11)  SimpleSocket |   3 条评论  18 
    文章评分 0 次,平均分 0.0

    Introduction

    SimpleSocket is a C++ library making socket based client/server programming easier. The library consists of the classes Socket and ServerSocket. These classes can be used in a similar way as the Java classes of the same name. It makes use of C++ stream to send data to and fro. SimpleSocket has been tested in the GNU cygwin environment on both Windows98 and Windows NT4 and on a Silicon Graphics Origin200 (IRIX 6.5). The library is expected to work on Linux or other Unix variants, with few changes. SimpleSocket makes use of the SimpleException and SimpleMessage libraries. These libraries can also be used for other purposes.
    Installation

    Download the SimpleSocket library and save it to a new directory. In this directory type the following:
    %gunzip SimpleSock.tar.gz
    %tar xf SimpleSock.tar
    The following files are extracted from the archive:
    SimpleSock.cpp SimpleSock.h SimpleException.h
    ssock_client.cpp ssock_server.cpp SimpleMessage.h
    Makefile Makefile.cygwin Makefile.sgi
    If you use the cygwin environment, type:
    %cp Makefile.cygwin Makefile
    If you use the SGI MIPSPRO C++ compiler on IRIX, type:
    %cp Makefile.sgi Makefile
    On other platforms you may need to make changes to one of these makefiles.

    Make the SimpleSocket library, the test server (ssock_server) and the test client (ssock_client):
    %make
    Test the library

    To test the library, run the server (in the background) and the client:
    %ssock_server&

    %ssock_client
    Create your own client/server apps

    After taking a look at the make files and the sources, it should be clear how to make your own socket based client/server applications. Make sure that you use exceptions to catch errors. If your server has to handle more than one client, you probably need to use threads. Good luck!

     

    除特别注明外,本站所有文章均为String me = "Creater\忠实的资深Linux玩家";原创,转载请注明出处来自http://unix8.net/home.php/1471.html

    关于

    发表评论

    暂无评论

    切换注册

    登录

    忘记密码 ?

    切换登录

    注册

    扫一扫二维码分享