Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
438 B

  1. #include <sys/types.h>
  2. #ifndef __MINGW32__
  3. #include <unistd.h>
  4. #include <sys/socket.h>
  5. #include <netinet/in.h>
  6. #endif
  7. #include "windoze.h"
  8. #include "socket.h"
  9. #include "ndelay.h"
  10. int socket_udp4b(void) {
  11. int s;
  12. __winsock_init();
  13. s = winsock2errno(socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP));
  14. return s;
  15. }
  16. int socket_udp4(void) {
  17. int s;
  18. s=socket_udp4b();
  19. if (s!=-1 && ndelay_on(s) == -1) { close(s); return -1; }
  20. return s;
  21. }