Comments (17)
Hmm.. strange, I've never seen this... I can't seem to reproduce this yet with frog 0.13.5 and a simpel telnet connection. So when the client disconnects it enters the continuous loop? What client are you using? Could it be a client-side issue?
from frog.
Try to connect using Telnet on Windows, give some random input and then quit Telnet using ^].
from frog.
That's what I did with telnet on linux. I don't have any Windows machine to test though. I wonder if the windows telnet client emits an extra \r
prior to \n
that triggers the bug, or does the problem also reproduce if you use the telnet inside the LaMachine VM?
from frog.
Using telnet on Linux gives me no problems. However, I have written a Java client which has the same problem, no "\r" there. I haven't really looked into the loop, but I guess it doesn't see the connection is lost?
from frog.
Well, detecting that 'the other side' is misbehaving in a TCP connection is quite hard.
Frog DOES honor both \r and \n line endings (and mix-ups)
A good client should close the connection/socket when done. Don't know about your Java client?
If not, then TCP timeouts should occur, but that can take a LONG time:
The default value on Linux is 7200 seconds! So after 2 hours and then 9 retries, the connection should be dropped.
I tried playing with TCP_KEEPALIVE, but as I don't have a misbehaving client, I cannot test it.
from frog.
closed due to inactivity on the isssue
from frog.
I have the same problem. I am trying to communicate with a C# program with frog. As long I dont close the TCP connection with frog I am able to get things working. When the tcp connection closes (unit test fininshs) seems frog gets into an endless loop
[TestClass]
public class FrogClientTest
{
[TestMethod]
public void Test()
{
IPHostEntry ipHostInfo = Dns.GetHostEntry("localhost");
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint remoteEP = new IPEndPoint(ipAddress, 1234);
// Create a TCP/IP socket.
Socket client = new Socket(ipAddress.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
client.Connect(remoteEP);
string eot = "Dit is een test text" + "\nEOT\n";
byte[] byteDataNewLine = Encoding.UTF8.GetBytes(eot);
client.Send(byteDataNewLine);
var buffer = new byte[4096];
int read = 0;
StringBuilder result = new StringBuilder();
do
{
read = client.Receive(buffer);
string receivedText = Encoding.UTF8.GetString(buffer, 0, read);
result.Append(receivedText);
} while (read == buffer.Length);
var response = result.ToString();
Assert.IsNotNull(response);
Assert.IsFalse(string.IsNullOrEmpty(response));
}
}
from frog.
Well, we don't have or do Windows nor C# here, but, looking at your code, I wonder:
What if you explicitly close and/or delete your client?
You do a 'new Socket()' and then Connect() to it.
I assume you can Close() it too?
And maybe C# does garbage collection, but still, a 'delete client' might be worth testing.
from frog.
yes I can do a Close() but the behavior stays the same. If I dont call the explicit closem the close happens because the process terminates
from frog.
Well, this is difficult to fix, as this seems a Windows only problem.
Explicitly calling client.Delete() didn't help too?
One last resort might be calling client.Shutdown() before close() as MS advises.
from frog.
Did you also try with \r\n
instead of \n
? Does that make a difference? (just a wild guess)
from frog.
I tried both suggestions, but unfortunately no luck
from frog.
Ok, I committed 2 small fixes. One in ticcutils, and one in frog.
I hope this will help.
You need the master versions from git, or lamachine-dev to test this.
from frog.
cool thanks. I will check it out. I need to setup a development environment as we been using the dockers till now
from frog.
Is this fix already in one of the dockers included?
from frog.
As it's not formally released yet it's not in the latest LaMachine docker image on Docker Hub yet. However, you can always simply do a LaMachine docker build of the latest development releases if you want (we don't push those to docker hub), just follow the instructions in the LaMachine bootstrap procedure, see https://proycon.github.io/LaMachine. (but be aware that development releases are by definition experimental and might break)
from frog.
assume this is solved now
from frog.
Related Issues (20)
- segmentation fault when invoked with a missing [[tokenizer]] section in the configuration HOT 5
- Server mode creates only 1 paragraph HOT 2
- Add JSON output as an alternative to 'tabbed' format HOT 3
- Frog breaks while processing large amount of txt data HOT 11
- Keep the deep_morph structure intact when resolving MWU's HOT 1
- Simplify option and configuration handling
- MWU output when no Parser is selected HOT 7
- Update debian package for v0.20
- Python Frog HOT 2
- Frog (through python-frog) accumulates a huge number of temporary files HOT 11
- Praktische vragen rondom grote datasets HOT 7
- Bug: frog server; frog-:connection lost unexpected : write to client failed HOT 2
- Segfault on FoLiA in to FoLiA out (speech data with events and utterances) HOT 7
- New release? HOT 3
- frog lemmatizer with --deep-morph misses a morpheme in FoLiA output
- [Docker] Initialization fails for nld-vnn and dum HOT 7
- Frog Chunker creates invalid FoLiA HOT 2
- released frog (0.29) depends on unreleased libfolia (2.15) HOT 2
- Building on Ubuntu 22.04 LTS Pop!_OS HOT 1
- Regression: Frog no longer outputs both FoLiA XML and columned output when requested HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frog.