小编use*_*956的帖子

连接错误:“没有到主机的路由”

我正在编写一个基于 AX.25 协议的服务器/客户端 c 程序。服务器创建套接字,成功绑定并侦听即将到来的连接。客户端在不同的线程中运行但连接失败并显示“没有到主机的路由”

服务器代码

#include <sys/socket.h>
#include <netax25/ax25.h>
#include <netax25/axlib.h>
#include <netax25/axconfig.h>

#include <stdio.h>
#include <arpa/inet.h>

#include <stdio.h>
#include <string.h>
#include <unistd.h>

#include <signal.h>
#include <syslog.h>

#include <sys/types.h>
#include <linux/socket.h>
#include <stdlib.h>

#include <sys/un.h>

#include <string.h>
#include <errno.h>



int main(int argc,char **argv,char **envp) {


    int ax25_socket = -1;
    unsigned char buffer[512];

    struct full_sockaddr_ax25 addr, axconnect ;

      char *port ="3";// sm0 port number:3
      char *call = "OH2BNS-8";// sm0 callsign


      bzero((char *) &addr, sizeof(struct full_sockaddr_ax25));

        addr.fsa_ax25.sax25_family = AF_AX25;
        addr.fsa_ax25.sax25_ndigis = …
Run Code Online (Sandbox Code Playgroud)

c sockets linux

6
推荐指数
1
解决办法
4万
查看次数

标签 统计

c ×1

linux ×1

sockets ×1