LinuxQuestions.org
Help answer threads with 0 replies.
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 12-16-2010, 03:09 AM   #1
xuniuer
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
Unhappy Linux - Bonding - UDP Server receive two pieces of data at a time from client


Hi Folks,

Although the problem is not related to Linux directly when I write a Python script to setup an UDP server to listen data from client, I guess it should be about Linux networking. The following is some basic information.

The server is a Linux-hosted box with RHAS 5.0. And it's configured to bond0 with mode = 0 (eth0 and eth1). The host can ping its peers in local network and ping google.com normally.

However, when I prepare for a UDP server script in Python to try to listen all clients from outside and echo out for testing (see below), I always received at a time two pieces of data from client.
-------------
#!/usr/bin/env python
# UDP Echo Server - udpechoserver.py

import socket

host = ''
port = 7878

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))

print "Server is starting(%s, %d)" % (host, port)

while 1:
try:
message, address = s.recvfrom(8192)
print "Got data from", address
print message
except KeyboardInterrupt:
print "Server is showdown manually"
break
--------------

I ensure I send out ONE message from client per time, so I guess it should be a configuration typo somewhere. But where is it? Appreciated any reply.

Last edited by xuniuer; 12-16-2010 at 03:13 AM. Reason: NONE
 
Old 12-16-2010, 08:43 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Welcome to LQ!

I moved your thread to Linux - Networking

 
  


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
Perl: UDP server receive / send packet to host superm@n Programming 2 04-02-2010 07:22 AM
How can I receive a 100kb data on a Linux server NancyT Programming 7 11-12-2008 06:13 PM
How can I receive a 100kb data on a Linux server NancyT Linux - Server 1 11-12-2008 05:17 AM
Unable to receive data in an udp socket stephenwalter Programming 8 11-24-2005 11:20 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM

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

All times are GMT -5. The time now is 03:36 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