Programming :: Weird Recv() Buffer Back To Front??
Sep 20, 2010
I have been developing some code which I have been testing an another i386 system. However I have been getting some weird data received on a socket I am communicating with some 3rd party hardware, I have opened a socket to read data on the hardware's telnet port. The data being read is as expected and my code appears to function correctly.
However I have now began testing the code on a target platform, this platform is of a better spec than my development system. When I read data from the socket using recv(), all the expected data has not been read.A chunk of data from the beginning is missing and a portion of data that would be at the end is now at the beginning of the buffer. I'll try and illustrate this below.
[Code]...
View 6 Replies
ADVERTISEMENT
Sep 29, 2010
I have scoured google for ways to get the source address of the client sent to my server which receives using UDP sockets.
I get the packet with no issue, but I would like to get the source address. Where it currently uses 192.168.0.103, I would like it to be this address.
Code:
#include "rbsocket.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
[Code].....
View 3 Replies
View Related
Jul 30, 2011
I am making a library, but I am facing a strange problem while sending data over network using ethernet.
I am sending 39 bytes of the data from one server to slave application but some time slave receives 39 bytes and some time it receives 29 bytes. And when ever slave receives 29 bytes all the memories to which my pointers are pointing get changed. This problem is only when I am sending data from the server to slave, while sending data from slave to server I am facing no such issue.
View 10 Replies
View Related
Jan 21, 2010
I need to use php to run some scripts locally. I tried it with system, exec But it only brings back on line. Ideally I want to take all the out put back on my browser.
PHP ------>shell scripts ------> error + plus out put
^--------------------------------------------|
some thing like that.
View 1 Replies
View Related
Jul 6, 2010
how to increase the scroll-back buffer? In LXTerminal, I can only scroll back about three screens.
View 6 Replies
View Related
Aug 6, 2010
what the following means and what I can do, if possible, to fix it:
Code:
Couldn't reference dri2 back buffer handle 0x00000002: No such file or directory
Segmentation fault I know what segmentation fault is, but the rest is a mystery to me. This is on OpenSuse 11.3, 64bit.
I get it from some games I installed for the kids to play, but obviously they can't until I've managed to fix that. It happens in Ppracer and Super Maryo Chronicles, and the games worked fine in 11.2. Same graphics card too, and the same xorg.conf file. DRI is enabled in that config-file.
The gfx-card works fine otherwise, and it's an Intel G33 GPU. I do get some lock-ups now and then, but I'm not sure if it's the gfx-card/driver or something else.
View 4 Replies
View Related
Jan 1, 2010
Currently, my disk layout is: 20GB(windows-ntfs) / 250GB data-ext4 / 20GB ubuntu-ext4 / 4gb swap
Since I no longer use windows, I want to move ubuntu to the first place.
What do I need to change in configuration files, grub and anywhere else?
Shoudl I keep swap where it is or move it, too?
View 9 Replies
View Related
Oct 21, 2010
I lost front audio after alsa upgrade to 1.0.23 headphone and mic doesn't work anymore . Anybody out there who can help a newbee.
HDA-Intel - HDA ATI SB VIA VT1708S ALSA Information Script v 0.4.59.doc
ALSA Information Script .doc
View 1 Replies
View Related
Dec 25, 2010
I have a device that is working on modbus protocol andI have written a small program(with block TCP read method ) to read its registers via modbus protocol.my program is working very well but except those times that I unplug the Ethernet cable or turning off the modbus gateway during programs work.at this time my program stops on recv system call (if it reach this system call exacly when I unplug Ethernet cable or turning off the modbus gateway during programs work).I changed my source to work in nonblock TCP method, at this time with the same situation my program does not stop/block on recv system call but after pluging back the Ethernet cable or resuming the connectivity situation back it reads data incorrectly .this is my code:Quote:
#define DEBUG
#include <fcntl.h>
#include <string.h>
[code]...
View 5 Replies
View Related
Oct 31, 2010
What graphical programming front is best to use for Java and Objective-C programming. I have something in mind like Xcode on Mac.
View 4 Replies
View Related
Mar 4, 2010
Code:
char retBuffer[100];
recv(sock , retBuffer ,sizeof(retBuffer) , 0);
if i send a string smaller then my buffer size retBuffer always have garbage of the end of it....what can i do to eliminate tis problem ?
View 2 Replies
View Related
Apr 12, 2011
Greetings EveryOne
how to check if buffer is empty in c?
View 14 Replies
View Related
May 19, 2010
writing a code in C program for debugging error and sendingror messagein routingprotocols. please answer with code
View 2 Replies
View Related
Jul 21, 2010
I wanna capture network packets from DMA ring buffer, just like netfilter. i wanna capture it from DMA, because i wanna get MAC address of I/O packets, so netfilter not included MAC address of out going packets because its on IP level and Ebtables is like that too. how i can capture network packets from DMA ring buffer.
View 9 Replies
View Related
Feb 5, 2009
I add new syscall, and it need copy big data into the buffer specified in user mode. How can i do it? use copy_to_user? or can i use memcpy directly? If i use copy_to_use, is it low efficient?v
View 2 Replies
View Related
Apr 6, 2009
Code:-ask the user which files they want to sent (files not needed to be in the same directore-tar all the files together-Gzip the tarfile-Uuencode the gsipped file (so more email programs can use it)-ask user who to send email to, possibly more than one person-I want it to be clear and easy to use and display what it is doing while an action is taken place.I have no clue where to begin. I think perl would be the best option, but I am not sure, how would I make this able to run with am email program and I am unaware how to tar and gzip files or Uuencode the gsipped files.
View 3 Replies
View Related
Jan 9, 2010
The algorithm for reading and writing disk blocks use the algorithm getblk to allocate buffers from the pool. In the algorithm getblk, if the kernel removes a buffer from the free list, it must raise the processor priority level to block out interrupts before checking the free list. Why ?Where can i find the C implementation of the above algorithm for buffer allocation in the linux source code ?
View 1 Replies
View Related
Feb 9, 2011
create a large buffer in my program so that I can send, and then receive on another pc, more than 4096 bytes (this seems to be the default for the serial port). I thought this might work:
[code]...
View 9 Replies
View Related
Feb 11, 2011
So I just turned my computer on and it was beeping rapidly, and it would stop if I hit "Enter". Also this came on my screen: Cannot set Fray", something like that. It boots fine..just what is that?
View 1 Replies
View Related
Apr 17, 2010
I've got a weird segmentation fault on the ending 'retq' instruction of my alarm callback, as if "calling pointer size" mismatched the 'q' of the 64bit retq. I've been trying to understand this bug for a while and couldn't get a clue. This code worked well on 32bit Slackware/Ubuntu/Debian. It now crashes on my 64bit Slackware install. I've written a small test case script for those who want to try it :
Code:
#!/bin/sh
#test-sigalrm-pack.sh
# 64bit sigalrm segmentation fault test case package...
echo " * Generating source..."
cat>tst-sigalrm.cpp<<TESTSRC
//tst-sigalrm.cpp
[Code]...
Paste this script into a file (like "test-sigalrm-pack.sh") and execute it ( $ sh test-sigalrm-pack.sh ), it will generate a cpp file (the source) and another script file that use the kind of link I need (static link) in the current directory. Also in order to link you might want to create a symbolic link to you glibc files (see note in the build script), I don't know how to do that "universally" (without the symbolic link 'hack')
View 14 Replies
View Related
Jun 25, 2010
When I do an amcheck, I get this Amanda Backup Client Hosts Check WARNING: noname.com: selfcheck request failed: recv error: Connection reset by peer Client check: 1 host checked in 0.022 seconds. 1 problem found.
I am using bsdtcp. I get an ack error if I switch the client to bsd authentication. What should I do, how do I fix it? I read that I should enter servers address to hosts file in /etc/ directory? Here is the log in /var/log/messages:
[Code]....
View 1 Replies
View Related
Feb 22, 2011
when i ran amcheck DailySet1 as backup user and got these messages:
[Code]....
View 3 Replies
View Related
Jul 15, 2010
I have a bash script called bash I am trying to execute from PHP. I think I have that right (not sure yet). Ideally let me explain what I am doing. The front end will pass a variable from a text entry box, called New_Task, the New_Task needs to be executed in the bash script and the output needs to be displayed back on the front end. So let me give some code and let me know what you all think.bash code is quite long, but essentially it is made to take a entry and create a task out of it. eg. "svn branch <Task Name>". The code below is getting the New_Task variable passed from the text entry box ($NewTask) and I have an exec for the bash script, but I am not sure it is working, I need to add some code to see the input in the front end.PHP back end code:PHP Code:
function mTaskCreator()
{
$strAction = $this->_objUserContext->mGetPostVar( 'acti
[code]...
View 7 Replies
View Related
Feb 16, 2010
I am working in HP UNIX. I have one process which is running continuously.There is log file generated for the process. I want to take back up of file without loosing any logs after particular interval of time or say file size increases more that 1GB.
View 3 Replies
View Related
May 19, 2010
I have a server which is used by number of client Apps. Now when a client initiates a sendto request to a server it has to respond(after recvfrom) by sending a message using sendto back to client and this should be done back and forth.
What I dont understand is, does the client have to open a new port to receive packets from client? If yes, then how will server know to what port of the client(assuming server ports are well-known to clients)?
I had given up on sending messages back and forth using UDP and switched to TCP. I could send a read and write message back and forth. But the trouble comes when I have more than one client wanting to talk to server using SOCK_STREAM. The first one gets through but the second client seems to get blocked forever(but I got no error upon socket creation or upon connect with the server on the same port as the previous client)..
View 4 Replies
View Related
May 29, 2011
PI'm trying to write a script to list all open ports in the MINIUNPND chain in iptables and use the procotol, port and destination ip to open ports on another router using upnpc.Here is the output of iptables -L MINIUPNPD
Code:
>iptables -L MINIUPNPD
Chain MINIUPNPD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:19955
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:20054
ACCEPT tcp -- anywhere 192.168.3.130 udp dpt:10654
ACCEPT tcp -- anywhere 192.168.3.121 tcp dpt:29955
code....
No matter what i do i cant seem to remove the first 4 characters from the MYPROT array to leave only the digits. Also i cant seem to read the array back???
I thought it would simply be a loop reading each line and passing the fields in variables, executing upnpc commands i need then moving to the next line of the file until it reached the EOF.
View 12 Replies
View Related
May 2, 2010
Whenever I'm running my application process, I've 1M physical memory usage is increasing for every 2 hours.This I observed using 'free -m' command.But 'top' command did not showing any increase 'RSS' size.It is same as it was started initially.Even though I stopped my process,the increased memory was not released back. If I start my application process then again memory usage start increasing by 1M for every 2 hours. increase of memory usage observer with 'free' and that too when my application is running, but top command is not showing any change in the RSS sizeIf my application is leaking any memory which is allocated by new/malloc, that should be released back whenever my application exit and the size increase will be show through top command for that process, right? This is not happeningThis proves that there is no potential leaks in my process.But why physical memory is increasing when only my process is running?
View 14 Replies
View Related
Jan 31, 2010
The microphone input of the soundcard itself (it is an on-board Realtek card, standard with most Nforce4 boards) works just fine. Recording quality is very good. But when I try to use the mic input on the front of my PC case, pulseaudio receives no signal from the microphone. Skype doesn't work, Audacity can't record anything either.
Everything is wired inside the case just fine, Windows XP has no problems in using the input on the front. Also the Line-out at the same panel on the front works in F12 without problems, it is just the mic input that doesn't work.
View 3 Replies
View Related
Oct 5, 2010
Is there a front end for LVM management like the "Expert Partioner" in YAST (OpenSUSE)?
View 3 Replies
View Related
Sep 16, 2011
I'm often playing videos from my external hard disk, and, well, it has issues. It'll often spin down and it often takes 5-10 seconds to spin back up in order to keep reading files. This is really terrible for video playback, as it'll often completely hang until the drive spins back up. Is there a way that I can tell VLC to set a larger buffer to at least give me more buffer into the future so the drive will have time to spin up when the buffer runs out?
View 1 Replies
View Related