阿里云平台使用apl

本文详细介绍了如何在阿里云平台上使用apl进行服务器管理和网络配置,包括登录、资源创建、网络设置等关键步骤,帮助用户高效操作云服务。
摘要由CSDN通过智能技术生成
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include <netdb.h>
int main(int argc,char **argv)
{
	int ret;
	int tcpsock;
	char rbuf[10000]={0};
	
	//获取阿里云api市场中,购买的那个物流查询服务器的信息
	struct hostent *p=gethostbyname("wuliu.market.alicloudapi.com");
	
	//ip地址不能直接打印,需要转换 char *inet_ntoa(struct in_addr in);
	//*(p+1)等价于p[1]
	struct in_addr * q=(struct in_addr *)(p->h_addr_list[0]);
	printf("物流查询服务器的ip: %s\n",inet_ntoa(*q));

	//定义ipv4地址结构体变量,存放需要绑定的ip和端口号
	struct sockaddr_in bindaddr;
	bzero(&bindaddr,sizeof(bindaddr));
	bindaddr.sin_family=AF_INET;  
	bindaddr.sin_port=htons(20000);  //小端序--》转换成大端序
	bindad
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值