Know of any cross platform socket library (windows & Linux) in C?

前端 未结 6 1087
自闭症患者
自闭症患者 2021-02-07 12:23

I am looking to do socket communications (listen, accept, connect, recv, send, disconnect) in both linux and windows. My project is in C, so unless someone can think of a way fo

6条回答
  •  清酒与你
    2021-02-07 12:59

    I don't know one library that complies both Windows and Linux but I think winsock is similar enough to Linux socket programming.

    In particular it supplies you 'select()' and the other functions mentioned. I guess you will need a very thin #ifdef wrapper to avoid type casting warnings.

    See here the winsock page for select

提交回复
热议问题