mirror of
https://github.com/yoboujon/tsock.git
synced 2025-06-08 05:50:50 +02:00
20 lines
No EOL
519 B
C
20 lines
No EOL
519 B
C
#include "source.h"
|
|
|
|
int launchSource(void)
|
|
{
|
|
int sock;
|
|
int lg_emis;
|
|
struct hostent *hp;
|
|
struct sockaddr_in socketSource;
|
|
if((sock=socket(AF_INET,SOCK_DGRAM,0)) == -1)
|
|
{
|
|
printf("échec création du socket\n");
|
|
exit(1);
|
|
}
|
|
memset(&socketSource, 0, sizeof(socketSource));
|
|
initSocketAddr(&socketSource,1);
|
|
lg_emis=sendto(sock, "aaaaa", 6, 0, (struct sockaddr*)&socketSource, sizeof(socketSource));
|
|
printf("lgemis = %d\n",lg_emis);
|
|
close(sock);
|
|
return 0;
|
|
} |