tcp.h
上传用户:feituo2008
上传日期:2013-02-02
资源大小:493k
文件大小:1k
源码类别:

Email客户端

开发平台:

Visual C++

  1. #ifndef __TCP_H__
  2. #define __TCP_H__
  3. #include <winsock.h>
  4. #define WM_TCP WM_APP+100
  5. //extern int sd_connect, sd_bind, sd_accept;
  6. int tcp_init();
  7. int tcp_exit();
  8. int tcp_status(int  sd, char *type, int timeout);
  9. int tcp_bind(HWND hWnd, int port);
  10. int tcp_accept(int sd, int timeout);
  11. int tcp_connect(char *hostname, int port, int timeout, int f_noblock);
  12. void tcp_disconnect(int sd);
  13. void tcp_close(int sd);
  14. int tcp_send(int sd, char *buf, int len, int timeout);
  15. int tcp_recv(int sd, char *buf, int len, int timeout);
  16. int tcp_gethostnamebyip(char *ip, char *name);
  17. unsigned short tcp_htons(unsigned short);
  18. unsigned short tcp_ntohs(unsigned short);
  19. unsigned long int tcp_htonl(unsigned long int);
  20. unsigned long int tcp_ntohl(unsigned long int);
  21. unsigned __int64 tcp_ntohh(unsigned __int64);
  22. unsigned __int64 tcp_htonh(unsigned __int64);
  23. float tcp_htonf(float f);
  24. float tcp_ntohf(float f);
  25. double tcp_htond(double d);
  26. double tcp_ntohd(double d);
  27. char *get_remote_ip(int sd, char *ip);
  28. #endif