LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2009, 01:45 PM   #1
wiener
LQ Newbie
 
Registered: Jun 2009
Posts: 22

Rep: Reputation: 0
TCP CONNECT fails


Hi there,
I have a problem with socket programing. I have a database server running over Windows XP, and 2 clients. One is a Unix Solaris machine, and the other is a LInux Debian.

I wrote the same C program for both clients, but get different results.
I created a TCP socket, put it in blocking mode and call 'connect'.
When the Linux client runs this code, the Windows server completes the
TCP hanshake with the client (It gets the SYN, answeres with SYN/ACK
and then the client sends an ACK).

Yet, when I run the same code from the Unix client, the call to 'connect'
results in the client sending the SYN packet, but it is ignored by the
server.
I run Wireshark sniffer at the server and saw that the SYN arrived.

Does anyone know what change should I make in my code, so it can be used
both by Linux and Unix?

Thanks in advance,
Moses.
 
Old 10-24-2009, 05:28 AM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
When having network connection problems, first thing it to (temporarily) stop all firewalls to see if there's some firewall blocking requests. If this is the case, then start investigating on differences between the two clients you're using: are they connected to the server in the same way?
Are they in the same network? I mean, within the same IP address range? If not, maybe the server is bound to a specific address, other than 0.0.0.0?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP handshake fails, SYN/ACK ignored by system. xnomad Linux - Networking 1 09-28-2011 11:10 AM
Ping always fails but TCP/IP & everything else works nsfx Linux - Networking 5 04-09-2007 01:59 PM
Connect TCP Tarekaz Linux - Newbie 18 02-16-2006 02:31 PM
recv() fails, tcp dump says i'm receiving isakmp packets rdarbin Linux - Networking 0 12-21-2005 12:06 PM
MySQL connection over TCP/IP fails Rukawa Linux - Software 4 11-29-2003 11:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration