Networking :: Non Blocking Socket Doing Other Tasks While Waiting For Connections In C Program?

Oct 27, 2010

I need to write program for non blocking socket connections.I have made extensive research but could only get to non blocking READ or WRITE after the connection is established. run the program do a series of tasks (ex: counter printing time on screen) if there is request for connection, connect send or receive data.

View 1 Replies


Programming :: Close A Socket And Refuse Waiting Connections?

Jan 4, 2010

i've written a socket server. when i launch a client, it connects to servers running on various machines on my local network, which then reply to the client with some string messages, and the client exits.

however, when i launch the client repeatedly (say 5 or 6 times in quick succession) the client is unable to bind to its local port. this appears to be because servers are still trying to connect to the client machine's port, even though the client exited and shut the socket down. the actual error i receive is "Error binding socket to Address already in use".

so, is it enough just to shutdown and close a socket? is there some way that in doing so the client machine can send a CONNECTION_REFUSED message to any machine trying to connect to it? i am using PHP, not that that should make much of a difference i hope.

the problem resolves itself after around 20 seconds as the machines trying to connect to the client timeout. i still need to fix this issue though.

View 2 Replies View Related

Software :: Blocking Socket Vs Non-blocking Socket?

Mar 31, 2010

My question is quite simple:What are type of applications where socket in blocking mode can be used ?
And where non-blocking mode to be used ??

TCP is blocking by default.

View 2 Replies View Related

Ubuntu Networking :: Can't Identify Process/Unbind Socket Blocking MongoDB

Mar 27, 2011

I'm running Ubuntu 10.10 64bit, and I'm a newbie when it comes to networking.

My issue is that there seems to be a socket bound to a port blocking MongoDB from accessing it's usual port 27017. The strange thing that it was working just fine until recently and I can't figure out what I did to screw things up... I can make it use a different port but the reason why it can't bind to the default port and why I can't fix it is really bothering me. I've tried rebooting the machine even with nothing else running when I try to run Mongo is still blocked giving the following message:

ropes@ropes:~/mongodb-linux-x86_64-1.8.0/bin$ ./mongod
./mongod --help for help and startup options
Sun Mar 27 14:08:14 [initandlisten] MongoDB starting : pid=2718 port=27017 dbpath=/data/db/ 64-bit


View 5 Replies View Related

Server :: Socket Connections / Socket And TCP Connection For Connecting To An External System?

Dec 7, 2010

Anyone knows the difference between a socket and TCP connection for connecting to an external system?

View 1 Replies View Related

Software :: Waiting For Other Tasks

May 26, 2010

for the past several months now, whenever the YUM-deamon goes to automatically update, it just says "waiting for other tasks" and after about 10 min it says "can't get yum lock, other program accessing yum" or something to that effect.i get the same message if i try to manually install programs using the graphical program in gNu.

is there another deamon that also could be using yum or the database for programs? i haven't had too much time to trouble shoot the past few months, so i can't give you better descriptions i'm afraid.

View 2 Replies View Related

Fedora :: Kpackagekit Waiting For Other Tasks

Oct 3, 2010

Whenever I try to get KPackageKit to do anything, it says "Waiting for other tasks..." and just hangs. I can cancel (when there's a cancel button, but sometimes there's not) and yum runs just fine.Any advice on how to get this working? I hate hunting for the names of packages.

View 2 Replies View Related

Programming :: Non Blocking Socket Send

Mar 7, 2011

Been trying all sorts of different things to implement a non-blocking send on a TCP server socket.As I kill the client, the server keeps blocking on the send no matter what. Am I missing something? Any other way to do that without involving any additional thread?

View 4 Replies View Related

Fedora :: Kpackagekit "waiting For Other Tasks"?

Dec 16, 2009

i am a new fedora 12 user (kde spin, 64bit)but received not-so-nice welcome from kpackagekit. i cannot install anything it always complains that "waiting for other tasks". how do i solve this?yum also does not work telling that

Loaded plugins: presto, refresh-packagekit
Existing lock /var/run/ another copy is running as pid 1880.


View 3 Replies View Related

Ubuntu Security :: UFW Is Blocking Connections Even Though It's Set To Allow For In/Out

Aug 1, 2011

I might be misunderstanding the log but it looks like UFW is blocking connections. I want to allow all incoming and outgoing. I guess what I'm saying is that the servers on my computer will open ports but all other ports should respond with closed just like a default Ubuntu install. Trying to use UFW to monitor connections without really doing any firewalling.

Aug 1 07:14:07 universal-mechanism kernel: [311111.963762] [UFW BLOCK] IN=eth0 OUT= MAC=00:1f:c6:8a:e9:66:00:01:5c:32:f4:c1:08:00 SRC= DST= LEN=40 TOS=0x00 PREC=0x00 TTL=233 ID=51984 DF PROTO=TCP SPT=80 DPT=54466 WINDOW=8201 RES=0x00 RST URGP=0

View 2 Replies View Related

Server :: IP Blocking - Block ALL Connections Except For Certain Ones

Feb 8, 2011

Ok so, buddy of mine has his ssh server setup and upon checking his logs he sees a ton of failed attempts. Now obviously these are people that are scanning him and trying to brute force him. So is there a way to block them? We know you can block each IP but is there a way to block ALL connections except for certain ones, such as his and mine? Maybe a couple others.

View 6 Replies View Related

OpenSUSE Network :: SuSEfirewall Blocking All Connections Tunnelled Over Ssh

Sep 14, 2010

My home computer has 11.3 and SuSEfirewall enabled. It connects to the net over the wireless and SuSEfirewall has this connection in the external zone.

I can successfully ssh into this computer from remote (the work computer) but none of the ssh port-forwarded connections work. I'm trying to tunnel VNC over ssh. I also tried setting http on the home computer to serve pages on a high-numbered port (8090) and tunnelling that but it also didn't work - proving that it's not a VNC problem.

Here are the relevant messages from the firewall logs on the home machine:


I don't understand why this isn't working now, I had the same setup on 11.2 and it worked fine.

The is the public IP address of my home router, I don't understand why a connection would appear to be coming from there when I use ssh-tunnelling?

View 5 Replies View Related

Ubuntu Security :: Mobloquer Blocking Outgoing Connections?

Jan 18, 2010

Mobloquer starts up at boot and before I've even opened firefox or transmission or anything, mobloquer shows that is has started blocking several outgoing connections as well as ton of incoming connections. I was wondering if the outgoing connections is normal and what's a normal amount of network activity to show up in system monitor when I'm not actively using the internet.

View 2 Replies View Related

CentOS 5 :: Socket Programming: Accept()-ing All Pending Connections

May 28, 2009

I am writing a server which uses edge-triggered epoll. When the server calls accept(), it just extracts the first connection in the pending queue. If there are more connections that are waiting, can we make the server accept all the pending connections? I wrote a loop like the following:

do {
client_fd = accept(...);
/* Work with the client fd */
} while (client_fd != -1); [/code]

Doesn't seem to work. A related question, more a clarification, is as follows. My understanding was that a connect() at the client returns only when accept() in the server returns. Clearly, I was incorrect. Even with no accept() call in the server, my client was able to connect and send data. Am I getting this right?

View 2 Replies View Related

Networking :: Configuring Socket Timer To Release Socket Once The Connection Is Terminated?

Jun 4, 2010

I want to configure socket timer to release socket(port) once the connection is terminated. Do we have something in Linux OS to configure this delay to release socket?.

Any command, link or man-page anything will be helpful.

I browsed a lot but unable to find it.

View 1 Replies View Related

Networking :: /usr/sbin/in.telnetd: Getpeername: Socket Operation On Non-socket?

May 5, 2009

I had installed Fedora 10

Below is the output of uname -a

Linux #1 SMP Tue Nov 18 12:08:10 EST 2008 i686 i686 i386 GNU/Linux

I need to enable telnet service on it, then found xinetd and telnet-server not installed,

Then I had installed below
First I had installed Xinetd: xinetd-2.3.14-21.fc10.i386.rpm
then I had installed telnet-server: xinetd-2.3.14-21.fc10.i386.rpm

After installation I executed below commands

Service xinetd start
Chkconfig xinetd on
Chkconfig telnet on
Service iptables stop
Chkconfig iptables off
Iptables �F

After I had tried telnet localhost ----IT FAILED

when I run telnet server manually by issuing the below command
/usr/sbin/in.telnetd, I get below error
[COLOR="Red"]/usr/sbin/in.telnetd: getpeername: Socket operation on non-socket[/COLOR]

I have other system running same OS, I had followed the same steps discussed above to enable telnet, It works fine on it.

View 1 Replies View Related

Ubuntu :: Lightweight Program With Week And Day View / Advanced Repetitive Tasks

Apr 12, 2011

I've installed osmo , and lots of software from Software Center, but nothing suits me. What I need is a lightweight program, with this capabilities : week and day view, (something like google calendar)advanced repetitive tasks(on week criteria[so I will be able to set a task once in a week, once in two weeks , and so on]) and alarm

View 4 Replies View Related

Networking :: Multiple FTP Upload Socket Error "Connection Reset By Peer: Socket Write"

Jan 31, 2010

I am pragmatically trying to upload a list of files from my client machine to a proFTPd server I have running on Ubuntu. Every time I get several (around fifty) files into the transfer, I get the following error: Quote: Connection reset by peer: socket write error

I am able to remotely upload 25,000 small files of ~ 1K in size, but when I go to upload hundreds of 2-4 Mb files, I get a socket write error. Am I using up all available sockets before they can be released? If so, how do I release the sockets? If not, what does this error mean and why am I getting it?

View 1 Replies View Related

Security :: Blocking Program Access To Clipboard Data?

Feb 9, 2011

I'm running a program called Synergy+ to let my keyboard and mouse control multiple computers. One of Synergy+'s features is that clipboard (copy-paste) data is able to be shared, as in copy on one machine, paste onto another. I would like this functionality removed but Synergy+ has no way to disable it. I'm looking for any ideas to block clipboard data from being transferred. Is there a way to block a program from accessing the machine's clipboard data?

View 5 Replies View Related

Programming :: Use Hostname (a URL) In Socket Program?

Aug 2, 2010

I don't have the IP address & Port of the server but I know the hostname (URL) to establish a connection.How can I use it to get connected to the particular host?

View 4 Replies View Related

Fedora :: Kpackagekit Keeps Waiting Forever 'Waiting For Service To Start'

Dec 23, 2009

kpackagekit keeps waiting forever "Waiting for service to start".what is this service that it is waiting for? i am running fedora 12

View 1 Replies View Related

Debian :: Debian Blocking Outside Connections?

May 14, 2011

The below issue has been solved, the problem wasn't Debian but I simply didn't pay attention that somebody disabled port forwarding *facepalm*

View 5 Replies View Related

Ubuntu :: 2 Pptp Vpn Connections - When I Dial One Of My Vpn Connections, My Other Vpn Connections Be Disabled?

Feb 7, 2011

have a problem with my network-manager in ubuntu 10.10.when I dial one of my vpn connections, my other vpn connections be disabled and I can't use them!I tried to restart network-manager and gnome-panel, but it does't seem to solve this problem.

View 1 Replies View Related

Programming :: C - For System Calls, Is Blocking Or Non-blocking Default?

Mar 23, 2010

For system calls, is blocking or non-blocking default in C? Simple question, just am not seeing the answer super quickly.

View 4 Replies View Related

Programming :: Blocking And Non Blocking TCP Send/recv?

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 program is working very well but except those times that I unplug the Ethernet cable or turning off the modbus gateway during programs 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>


View 5 Replies View Related

Ubuntu Networking :: Purge Tasks In Evolution 2.30.3?

Jan 11, 2011

I'm running evolution 2.30.3 in ubuntu 10.10, with unity desktop, and I can't find the "purge" option for the tasks. As it disappeared or is it just me not finding it ? Also, while I'm here, I understand that unity is still in development. Where can I report the issues I notice while running it ?

View 3 Replies View Related

General :: Socket Programming - Feed Some Words One By One To The Socket

Jul 6, 2010

i'm writing a simple program of client socket program. Here below is the code sample which i'm writing...

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>

the above code works fine.if we copmile and run ./a.exe 1111 and press enter it works fine..everytime it asks "Please enter the message: " and if give that will be displayed in server. but my problem is i dont want to print everytime "Please enter the message: " i just want to feed some words one by one to the socket.

View 4 Replies View Related

Programming :: Setsockopt : Socket Operation On Non-socket Getting Error?

Mar 30, 2009

im getting that error in my code for some reason. I compiled my code, and when i try to run this server it throws me an error on my call to setsocketopt(). The only way it can reach that part of my loop is if it succeeds when it calls sock() so I dont understand why the error says its an operation on a non-socket. Im just trying to set up a server to pass messages from a client to it a viceversa. Here is the code:

int main()
int socket_fd, new_socket_fd, k;
struct addrinfo hints, *server_info, *p;
struct sockaddr_storage peer_address;

View 7 Replies View Related

Server :: Parse The Bunch Of Values Displayed By The Socket Program Into The Php File So That Further It Can Be Displayed In HTML Page?

Apr 15, 2011

How to parse the bunch of values displayed by the socket program into the php file so that further it can be displayed in HTML page

View 1 Replies View Related

General :: Socket Error / Socket 31: 0x36?

Sep 15, 2009

We are seeing recv err on socket 31: 0x36. What could be meaning of the error?.

View 1 Replies View Related

Copyrights 2005-15, All rights reserved