sockets

How can I forcibly close a TcpListener

I have a service which communicates through tcpListener. Problem is when the user restarts the service - an "Address already in use" exception is thrown, and the service cannot be started for a couple of minutes or so. Is there's any way of telling the system to terminate the old connection so I can open a new one? (I can't just use ran...

.net 3.5 message framing

We have message framing working by using a lengh prefix but using .NET 2.0 beginSend/BeginReceive. Is message framing any different in 3.5, if so how should we implement it using the new framework? Are there any useable examples out there which focus purely on message framing using 3.5? Many thanks ...

silverlight Socket: Unhandled Error in Silverlight Application An attempt was made to access a socket in a way forbidden by its access permissions.

I basically try to reproduce the Socket example from here: http://www.silverlightshow.net/items/Sockets-and-their-implementation-in-SL2-Beta-1-including-a-chat-like-example.aspx I only made a small change in the client side, i.e., String safeHost = "127.0.0.1"; int port = 4509; Then I got this permission error? Any idea w...

How do I get google protocol buffer messages over a socket connection without disconnecting the client?

Hi there, I'm attempting to send a .proto message from an iPhone application to a Java server via a socket connection. However so far I'm running into an issue when it comes to the server receiving the data; it only seems to process it after the client connection has been terminated. This points to me that the data is getting sent, but ...

How to make an existing socket fail?

OK. So, this is exactly the opposite of what everyone asks about in network programming. Usually, people ask how to make a broken socket work. I, on the other hand am looking for the opposite. I currently have sockets working fine, and want them to break to re-create this problem we are seeing. I am not sure how to go about intent...

How to get Acknowlegement in TCP communication in Java

I have written a socket program in Java. Both server and client can sent/receive data to each other. But I found that if client sends data to server using TCP then internally TCP sends acknowledgement to the client once the data is received by the server. I want to detect or handle that acknowledgement. How can I read or write data in TC...

New to JEE; architecture suggestions for a service/daemon?

I am brand new to the JEE world. As an exercise to try and familiarize myself with JEE, I'm trying to create a tiered web-app, but I'm getting a little stuck on what the best way is to spin up a service in the background that does work. Parameters of the service: It must open and hold a socket connection and receive information from t...

recvfrom returns invalid argument when *from* is passed

I am currently writing a small UDP server program in linux. The UDP server will receive packets from two different peers and will perform different operations based on from which peer it received the packet. I am trying to determine the source from where I receive the packet. However, when select returns and recvfrom is called, it return...

silverlight socket: implement two-way communications?

I basically try to reproduce the Socket example from here: http://www.silverlightshow.net/items/Sockets-and-their-implementation-in-SL2-Beta-1-including-a-chat-like-example.aspx. I have been able to get the message send from Client To Server using the following code. But how can the server response to client? Client Code: String safeHo...

HttpWebRequest socket operation during WPF binding in a property getter

In a property getter of a C# class I am doing a HTTP GET using HttpWebRequest to some https address. WPF's property binding seems to choke on this. If I try to access the property in a simple method e.g. Button_Clicked, it works perfectly. If I use WPF binding to access the same property, the app seems to be blocked on a socket's recv() ...

Troubleshooting occasional timeout of select() in windows

I'm having an occasional problem with select() timing out on me. I have it set for twenty seconds. The system will handle 100's of transactions correctly, but occasionally one fails with the selet timing out. It does about 1 transaction every few seconds, opening and closing the tcp conncetion with each transaction. I thought the ser...

Android Socket Connection

I'm guessing this will be such a newbee question but I hit a wall and... I am running the jWebSocket (http://jwebsocket.org) stand-alone server. For a client I am using Weberknecht (http://code.google.com/p/weberknecht/) And Eclipse is my IDE of choice. Now, when I start the server and run the Weberknecht client like a normal Java appl...

C# .NET Socket realtime video Block unblock

when i send realtime media message, socket were blocked and shut down itself. how can i deal with this case? some answers are buffer is not large enough,so can someone give me some demo?thanks ...

Boost ASIO Headache

Man... thought using ASIO in Boost was going to be easy and intuitive. :P I am starting to get it finally but I am having some trouble. Here's a snippet. I am having several compiler errors on the async_accept line. What am I doing wrong? :P I've based my code off of this page: http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/t...

C++ Program Flow: Sockets in an Object and the Main Function

I have a rather tricky problem regarding C++ program flow using sockets. Basically what I have is this: a simple command-line socket server program that listens on a socket and accepts one connection at a time. When that connection is lost it opens up for further connections. That socket communication system is contained in a class. ...

Problems in getting data from CFStreamCreatePairWithSocketToHost

Hi I'm building an iPhoe app with a socket to a PC app , I need to get an image from this PC app. It's my first time using "CFStreamCreatePairWithSocketToHost".After I establish the socket with "NSOperation" I call CFStreamClientContext streamContext = {0, self, NULL, NULL, NULL}; BOOL success = CFReadStreamSetClient(myReadStream, kMyNe...

disadvantages of CORBA over sockets

advantages of CORBA such as 1: language independence 2: location transparency i am curious to know what are the disadvantages of corba over sockets one of the possible disadvantage would be speed ...

HOW to send message from php to desktop app (c#)

Hello guys, Am developing a desktop app that will serve as message notifier, just like yahoo messenger and Gmail notifier does. All i want is that when a message is sent to a particular account, the php script would send message to a particular ip:port of the desktop application. Any help ...

Socket programming in perl, problem with perlio layer?

I'm noticing some problems with the perlio layer in perl. Took me a good day to track it down and was hoping some other people knew something about this? The scariest thing about this is that since its so low-level, I'm worried it'll reduce the code's portability. Server code: use strict; use Socket; socket(my $sock, AF_INET, SOCK_S...

What is java.net.SocketTimeoutException: Failed to receive close ack from remote connection?

Hi, I'm transfering a file across a LAN(using JxtaSocket in case you heard about it) and I receive: java.net.SocketTimeoutException: Failed to receive close ack from remote connection. at net.jxta.socket.JxtaSocket.close(JxtaSocket.java:1046) I would like to know what are the reasons this would happen in the first place. I'm receiving...