套接字默默无法连接。我错过了什么? [英] socket is silently not connecting. What am i missing?

查看:79
本文介绍了套接字默默无法连接。我错过了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,当我尝试连接时,我的套接字没有做任何事情。我有头文件和下面提供的类。除socket_connect()函数外,一切正常。

另外,我没有运行服务器。我有一个在localhost上运行的端口侦听器。但是,它不会检测到连接。我尝试在端口80上连接到google.com并发送内容,但它只是无法连接。

For some reason my socket isn''t doing anything when i try connect. I have the header file and the class provided below. Everything works except for the socket_connect() function.
Also, i do not have a server running. I have a port listener running on localhost. However, it wouldn''t detect a connection. I tried connecting to google.com on port 80 and sending something, but it just wouldn''t connect.

展开 | 选择 | Wrap | 行号

推荐答案

bump..anybody?
bump..anybody?


您是否介意将代码发布到您实例化的位置并使用套接字类。
Would you mind posting the code where you instanciate and use you socket class as well please.


确定:这里是main.cpp
sure: here is the main.cpp
Ex pand | 选择 | Wrap | 行号


这篇关于套接字默默无法连接。我错过了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆