From 7194b9d507c41fb61ed6e52ff901a49dc273198b Mon Sep 17 00:00:00 2001 From: Imanol-Mikel Barba Sabariego Date: Fri, 10 Jan 2014 11:44:02 +0000 Subject: [PATCH] git-svn-id: svn://imanolbarba.net/PAD@57 c2ee353e-ed0d-4329-bf56-03aec153487f --- JChatClient/bin/client | Bin 23296 -> 0 bytes JChatClient/src/Socket.cpp | 6 +++--- JChatServer/bin/pad/prac2/Connection.class | Bin 3730 -> 0 bytes JChatServerV2/bin/pad/prac2/Connection.class | Bin 3807 -> 0 bytes JChatServerV2/bin/pad/prac2/MySocket.class | Bin 3210 -> 0 bytes JChatServerV2/src/pad/prac2/MySocket.java | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) diff --git a/JChatClient/bin/client b/JChatClient/bin/client index 1d75fb1..3238bb1 100755 Binary files a/JChatClient/bin/client and b/JChatClient/bin/client differ diff --git a/JChatClient/src/Socket.cpp b/JChatClient/src/Socket.cpp index 440b407..11d4342 100644 --- a/JChatClient/src/Socket.cpp +++ b/JChatClient/src/Socket.cpp @@ -27,7 +27,7 @@ void Socket::Create() throw SocketException ( "TCP: Could not create socket" ); } setsockopt(sock,SOL_SOCKET,SO_KEEPALIVE,&optval,sizeof optval); - setsockopt(sock, SOL_TCP, TCP_NODELAY, &optval, sizeof optval); + setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof optval); } void Socket::Bind(string address, int port) @@ -35,7 +35,7 @@ void Socket::Bind(string address, int port) sockAddr.sin_family = AF_INET; sockAddr.sin_port = htons(port); sockAddr.sin_addr.s_addr = inet_addr(address.c_str()); - if(bind(sock, (struct sockaddr *)&sockAddr, sizeof(struct sockaddr)) != 0) + if(::bind(sock, (struct sockaddr *)&sockAddr, sizeof(struct sockaddr)) != 0) { stringstream sstream; sstream << "TCP: Could not bind to address " << address << " on port " << port; @@ -186,4 +186,4 @@ const Socket& Socket::operator >> ( std::string& text ) message = NULL; } return *this; -} \ No newline at end of file +} diff --git a/JChatServer/bin/pad/prac2/Connection.class b/JChatServer/bin/pad/prac2/Connection.class index 53b85cd..5d729df 100644 Binary files a/JChatServer/bin/pad/prac2/Connection.class and b/JChatServer/bin/pad/prac2/Connection.class differ diff --git a/JChatServerV2/bin/pad/prac2/Connection.class b/JChatServerV2/bin/pad/prac2/Connection.class index 45202b6..1172914 100644 Binary files a/JChatServerV2/bin/pad/prac2/Connection.class and b/JChatServerV2/bin/pad/prac2/Connection.class differ diff --git a/JChatServerV2/bin/pad/prac2/MySocket.class b/JChatServerV2/bin/pad/prac2/MySocket.class index ea93697..4e245d9 100644 Binary files a/JChatServerV2/bin/pad/prac2/MySocket.class and b/JChatServerV2/bin/pad/prac2/MySocket.class differ diff --git a/JChatServerV2/src/pad/prac2/MySocket.java b/JChatServerV2/src/pad/prac2/MySocket.java index 26d367b..36f8d98 100644 --- a/JChatServerV2/src/pad/prac2/MySocket.java +++ b/JChatServerV2/src/pad/prac2/MySocket.java @@ -37,7 +37,7 @@ public class MySocket extends Socket try { output = super.getOutputStream(); - input = new BufferedReader(new InputStreamReader(super.getInputStream())); + input = new BufferedReader(new InputStreamReader(super.getInputStream(),"UTF-8")); } catch(IOException ioExc) { -- libgit2 0.22.2