Portbase User Guide
//Creates the main function and calls the function.
int main(int argc, char *argv[])
{
char buff[1024];
int count = 0;
pid_t pid;
int ff;
struct sockaddr_in server_addr;
if (argc != 2)//Outputs a message if it is not the input format.
{
printf("How to run : %s Porter IP \n", argv[0]);
exit(0);
}
//Creates the socket.
if ((sock = socket(PF_INET, SOCK_STREAM, 0))<0)
{
printf("cant open socket!!\n");
exit(0);
}
bzero((char *)&server_addr, sizeof(server_addr));
//Fills the structure.
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = inet_addr(argv[1]);
server_addr.sin_port = htons(4001);
//Connects to the server.
if (connect(sock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0)
{
printf("cant connect to server!!\n");
exit(0);
}
while(1)
{
SendData();
sleep(3);
115
Содержание Portbase-3010
Страница 1: ......
Страница 61: ...Portbase User Guide 4 Click Next 5 Choose destination location and click Next 61 ...
Страница 90: ...Portbase User Guide Log Window 90 ...