473,394 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Wrong checksum - socket+fwrite

I have a problem with writting data to a Socket. It comes some
incorrect checksum (dump
with tcpdump)

Dump :

00:16:76:df:12:eb (oui Unknown) 00:04:23:c1:72:23 (oui Unknown),
ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 64, id 63018,
offset
0, flags [DF], proto: TCP (6), length: 50) 10.10.1.22.dnsix >
mk089144217176.a1.net.sbl: P, cksum 0x3e85 (incorrect (-0x261b),
1:11(10) ack 118 win 5840 urg 10
0x0000: 4500 0032 f62a 4000 4006 063b 0a0a 0116
0x0010: 5990 d9b0 005a 040f 1cc2 054c 0005 0ecc
0x0020: 5038 16d0 3e85 000a 3031 3334 3036 3936
0x0030: 3233

code:

$socket = stream_socket_server('tcp://10.10.1.22:90', $errno,
$errstr);
$conn = @stream_socket_accept($socket, 1);
$message = fread($conn, 8192);
$answer = "0134069623";
fwrite($conn, $answer);
fclose ($conn);
fclose($socket);

Sep 11 '07 #1
1 2622
On Sep 11, 6:47 pm, off...@jobnavigator.at wrote:
I have a problem with writting data to a Socket. It comes some
incorrect checksum (dump
with tcpdump)

Dump :

00:16:76:df:12:eb (oui Unknown) 00:04:23:c1:72:23 (oui Unknown),
ethertype IPv4 (0x0800), length 64: (tos 0x0, ttl 64, id 63018,
offset
0, flags [DF], proto: TCP (6), length: 50) 10.10.1.22.dnsix >
mk089144217176.a1.net.sbl: P, cksum 0x3e85 (incorrect (-0x261b),
1:11(10) ack 118 win 5840 urg 10
0x0000: 4500 0032 f62a 4000 4006 063b 0a0a 0116
0x0010: 5990 d9b0 005a 040f 1cc2 054c 0005 0ecc
0x0020: 5038 16d0 3e85 000a 3031 3334 3036 3936
0x0030: 3233

code:

$socket = stream_socket_server('tcp://10.10.1.22:90', $errno,
$errstr);
$conn = @stream_socket_accept($socket, 1);
$message = fread($conn, 8192);
$answer = "0134069623";
fwrite($conn, $answer);
fclose ($conn);
fclose($socket);
TCP checksum offloading is enabled on your card?
http://www.ethereal.com/lists/ethere.../msg00242.html

Sep 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Antoine Bloncourt | last post by:
Hello everybody Sorry to bother you but I have a problem writing datas into a file ... I want to make a backup of my MySQL database and put the result into a ..sql file. To do this, I use...
7
by: Martin | last post by:
I am a PHP newbie (just got my "Hello World" page working this morning). I'm doing some R&D work to see if PHP is viable for a situation I have. To accomplish what I want to do, I have to have the...
0
by: WebRod | last post by:
Hi, I use fsockopen to open a connection on a POP3 server. I use fwrite to send command to the pop3 server. I have a problem when the call between 2 fwrite is too long. The connection is...
2
by: pradeep | last post by:
I have 2 data files, DATA1 and DATA2 , both same. My task is to: Open DATA1, compute the checksum and put it in the end of the file(don't bother about boundary conditions).close DATA1 Open...
17
by: SW1 | last post by:
I wrote a small program which does something like tftp - transfering files and some chat, anyway i got a problem with fwrite, here is a snippet of my code: while(length > 0) { putchar('.');...
10
by: cs | last post by:
if i have typedef struct{ unsigned a; unsigned *b; }tp; i would like to ask if it is ok for the "C standard 89" doing something like this {
2
by: chellappa | last post by:
Hi Every body!, i did a small Chat program in Linux C Socket Programm ... I am using stdout/stdin i did in single machinee i will work properly..but i want to run in differnet machine..i tried...
1
by: Skeets | last post by:
i'm having some php problems. i have the following code on my main page: ------------ $fp = fsockopen("127.0.0.1", 49152, $errno, $errrstr, 30); if (!$fp) { echo "socket error: $errstr...
1
by: Chris | last post by:
Hi, I am using PHP persistent sockets and have a problem with them. The problem is that PHP only sends the data when the socket is closed. In the code example below the counterparty process...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.