Hi,
For my app, I need to record audio from MIC on an Android phone, and send it over TCP to the other android phone, where it needs to be played.
I am using AudioRecord and AudioTrack class. This works great with a file - write audio to the file using DataOutputStream, and read from it using DataInputStream.
However, if I obtain the ...
I am trying to pull some sample data from FreeDB as a proof of concept, but I am having a tough time retrieving all of the data off the incoming stream (I am only getting the last bits for the final query listed here (if handshakeCode = 3)
I think this may be something with the threading on the main runloop, but I am not sure. Odd thing...
After some googling an obvious answer or starting point for a Java IRC bot has not presented itself, my question; is there an existing framework to help me do build an IRC bot? Failing that, is this possible using Sockets in Java to do this and has anyone seen an example around the web?
cheers guys.
...
I'm working on the networking part of a 2 player game (similar to tetris), and I'm trying to pass the game grid from client to server and vice versa. However, when I tried using send(grid) I get a TypeError: send() argument 1 must be string or read-only buffer, not instance.
Is there anyway to circumvent this, or do I have to convert m...
I am trying to capture ip packets in c#.
Everything is working fine, except that i only get outgoing packets.
My Code:
using (Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP))
{
sock.Bind(new IPEndPoint(MYADDRESS, 0));
sock.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderInclude...
I'd like to make sure about the correctness of the way I try to use accept() on a socket.
I know that in Linux it's safe to listen() on a socket, fork() N children and then recv() the packets in all of them without any synchronisation from the user side (the packets get more or less load-balanced between the children). But that's UDP.
...
I am given the following declaration:
char inbuff[500], *ptr;
int n, bufferlen;
Write a program segement to receive a message having 500 bits from the TCP socket sock and store this message in inbuff.
My answer is:
n = recv( sock, inbuff, strlen( inbuff ), 0 );
However, I am not sure why *ptr is given in the declaration.
So, I w...
In UDP client after executing:
socket.SendTo(data, SendIP);
Why does socket.LocalEndPoint change?
...
I am supposed to connect to external server using UDP sockets in C#..
I could not understand these 2 lines in server usage notes:
"Use of dedicated sockets is enforced."
and
"If the server looses UDP connectivity with the client, it will ..."
I thought that the UDP socket is connectionless!
So what did "looses connectivity" mean? a...
After many hours, I have discovered that the given udp server needs the following steps for a successful communication:
1- Send "Start Message" on a given port
2- Wait to receive from server on any port
3- Then the port dedicated to you to send further data to the server equals the port you have received on it + 1
So I am asking if thi...
So, I made a simple socket server using python. And now I'm trying to structure a proper http response. However, I can't seem to find any sort of tutorial or spec that discusses how to format http responses.
Could someone point me to the right place?
...
I used to think that using SocketOptionName.ReuseAddress, I can reuse a port that is in TIME_WAIT state. But I tried to experiment with it and it seems it has no effect.
If I check sockets using netstat, and it shows the socket is in TIME_WAIT state and I immediately run the client again, I get the exception:
Only one usage of each ...
hi,
i have a simple server/client. and i am using the netcat as the client to test the server. if i stop the server before the client exit, i will not be able to start the server again for a while and i go this error:
"
[Errno 98] Address already in use
"
but if i close the client first, then the server stops, i will not have this issu...
Hi all,
I am facing a probleme with threads and sockets I cant figure it out, if someone can help me please i would really appreciate.
There are the facts :
I have a service class NetworkService, inside this class I have a Socket attribute.
I would like it be at the state of connected for the whole lifecycle of the service.
To conne...
What is the best way to accept new sockets in async way.
First way:
while (!abort && listener.Server.IsBound)
{
acceptedSocketEvent.Reset();
listener.BeginAcceptSocket(AcceptConnection, null);
bool signaled = false;
do
{
signaled = acceptedSocketEvent.WaitOne(1000, false);
} while (!signaled && !abort && l...
I have been messing around Boost Asio for some days now but I got stuck with this weird behavior. Please let me explain.
Computer A is sending continuos udp packets every 500 ms to computer B, computer B desires to read A's packets with it own velocity but only wants A's last packet, obviously the most updated one.
It has come to my at...
hi,
Using j2me i need to send a jpeg Image to a server using Socket Communication...can anyone send me a sample code for my application.
Thnks in Advance
Deva
...
I got a strange problem, I never actually expirienced this before, here is the code of the server (client is firefox in this case), the way I create it:
_Socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp );
_Socket.Bind( new IPEndPoint( Settings.IP, Settings.Port ) );
_Socket.Listen( 1000 );
_Socket.Bl...
I need to create Client/Server application to send files from clients to Server.
I use simple ssl sockets for that and authenticate with certificates.
ms = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ssl_sock = ssl.wrap_socket(ms,
keyfile=".../newCA/my_client.key",
certfile="...
Hi all,
I want TCP/IP based socket server application or code for Linux, which performs a very simple operation: reads xml string from one of the connected socket clients and forwards it to all socket clients which are connected to it.
I have such client server application developed in cocoa, but according to my requirements now I need...