sockets

Php-Flash communication over sockets

Good time of the day, dear developers! I am not any kind of network programming pro, but it happened that I have faced necessity to develop socket-server on php (no way for using Java) for flash multiplayer browser-game (standard features like locations, team battles, etc). The main problem is that TCP is point-to-point protocol and ...

How to detect when a socket can be closed?

I am printing to a thermal ticket printer which has no standard drivers. Traditionally our business process has been to produce a batch file of print items and to deliver that through an open socket to the printer. When the program has finished processing and prior to tidying up by shutting the socket I blocked the process by popping up ...

Can select() be used for clients, not just servers?

I'd like to make a TCP client that makes multiple connections while a select() loop that receives data from them is running in a separate thread. I'm not sure this is possible, though, because the select() loop is already running and thus I don't see how it would "notice" a new socket was added even if the thread-safety issues are dealt ...

Streaming input to System.Speech.Recognition.SpeechRecognitionEngine

Hello, I am trying to do "streaming" speech recognition in C# from a TCP socket. The problem I am having is that SpeechRecognitionEngine.SetInputToAudioStream() seems to require a Stream of a defined length which can seek. Right now the only way I can think to make this work is to repeatedly run the recognizer on a MemoryStream as more...

How do I redirect the input and output of a console C# program to a socket?

How do I redirect the input and output of a console C# program to a socket? I need to start the program from within another process, and make it receive input and emit output to another process running on another computer in the network. What I'm trying to do is to programmatically run an application on another station, while controlling...

AF_UNIX socket: can I pass socket handle between processes?

Let's say I create a socketpair() and I pass the handle of one of the socket to a spawned process (popen), will the said process be able to communicate back with the parent? The examples I saw are applied using fork() which is out of scope for my current project. Updated: I tried a simple test: Client: socketpair with sockets[0] Fro...

Socket.UseOnlyOverlappedIO?

Does anyone know what Socket.UseOnlyOverlappedIO does, and if so, does it affect performance? There seems to be no real explanation on MSDN. Thanks in advance. ...

Query related to Connection type BIS-B Socket in Blackberry application

Hi all, I am trying to establish BIS Socket connection. I am able to establish BIS Http connection from my service provider. I have downloaded one chat application that checks network types supported by my device/service plan which has following list: 1)BIS-Http : OK 2)BIS-SOCKET :OK 3)BES-HTTP : NA 4)BES-SOCKET : NA 5)TCP-HTTP : BAD D...

How to use simple TCP/IP sockets connection over Net.TCP WCF binding?

How to use simple TCP/IP sockets connections over/with Net.TCP WCF binding? Idea is – We have a web service with Net.TCP binding on some URL, port. We want to take advantage of the WCF address model and simplicity of socket connections. So can we use simple TCP/IP sockets connection over/with Net.TCP WCF binding? If yes. What do I ne...

What can cause select to block in Python?

Here's a snippet of code I'm using in a loop: while True: print 'loop' rlist, wlist, xlist = select.select(readers, [], [], TIMEOUT) print 'selected' # do stuff At a certain point, select will block and "selected" is never getting printed. What can cause this behavior? Is it possible there's some kind of deadlock? U...

How can I send data to multiple IPs in VB.NET with TCP/IP sockets?

I have an array of IP addresses, and I want to send the same data to all of them. I could just send the loop code that sends data but I think there's a better way of doing this. I've heard of multicast, what exactly is it? I think it's what I need but how do i use it. ...

what type of bug causes a program to slowly use more processor power and all of a sudden go to 100%?

Hi, I was hoping to get some good ideas as to what might be causing a really nasty bug. This is a program which is transmitting data over a socket, and also receives messages back. I could explain lots more, but I don't think this will help here. I'm just searching for hypothetical problems which can cause the following behaviour: p...

Splitting https between Apache and Game Server

Hi, i want to have both an Apache and a Game Server to be reachable on port 443 of the same IP address. The game server connection is a normal TCP connection that is established when the client logs in and stays open until the client logs out, perhaps hours later. At first I though about using mod_proxy in reversed mode and let the cl...

Can two application listen to the same port?

As simple as it gets - can two application on the same machine bind to the same port and ip address? Taking it a step further, can one app listen to requests coming from a certain ip and the other to another remote ip? I know I can have one application that starts off two threads (or forks) to have similar behavior, but can two applicat...

close() vs. shutdown() with recv()

I have the following code: Client side: n=recv(sock,buf,1200,NULL); Server side: shutdown(sockk,SD_BOTH); The problem is, the client side recv is returning 0, meaning graceful shutdown. I need it to return -1 (I can't change the client side, I need to adapt my code to it.) What can i do to cause it returning -1? ...

Cannot Close Socket After BeginAccept Method

Hello! I have a program in c# in which i create a socket, binding it, begin listening and then using beginaccept! but then when I try to close\shutdown the socket I get exceptions from the beginaccept AsyncCallback method! private void start_listening() { main_socket = new Socket(AddressFamily.InterNetwork, So...

Flash socket server only works on local machine

Hi, I have created a basic flash socket server in PHP, it all works fine on my local machine (both in the browser and in the flash sandbox) but as soon as I get another machine to connect to my computer's Site directory, they can't get a connection open to the server! In flash: mySocket.connect("localhost",9999); In PHP $address = '...

How to make an accepted socket non-blocking in java

I am accepting a connection from a client and then passing that connected socket off to another object, however, that socket needs to be non-blocking. I'm trying to use getChannel().configureBlocking(false) but that does not seem to be working. It needs to be non-blocking because this the method below is called every 100ms. Is there s...

select() on sockets with timeout

Inside the read FD_SET I have several sockets: the main socket listening for new connections accepted sockets listening for incoming data. I set the timeout for 30 seconds and called select(). I quickly noticed the behavior is different for each: When a new client connects on the listening port, it returns immediately from blocking...

C# Socket and ICMP

Hello. I'd like to know how to use sockets in .NET3.5 to send ICMP request. When I try to create my socket using this line : Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp); It doesn't works and send me an error (SocketException). Does anyone know how to do this using sockets? Thanks ...